/* Стили вкладки МКД, перенесённые из Биллинга */

.b24-mkd-root {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-bottom: 0;
}

.b24-mkd-root > .b24-section-chrome {
  overflow: visible;
  position: relative;
  z-index: 30;
}

.b24-mkd-root .b24-table-wrap {
  height: 100%;
  max-height: none;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.b24-mkd-root .b24-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5f7f8;
  box-shadow: 0 1px 0 #dfe3e6;
}

.b24-filter-check {
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.b24-filter-check input[type='checkbox'] {
  margin: 0;
}

#mkd-pager.b24-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  padding: 8px 16px;
}

#mkd-pager .b24-pager__page-size {
  flex: 0 0 auto;
}

#mkd-pager .b24-pager__summary {
  margin-left: auto;
  text-align: right;
}

.b24-input-page-size {
  min-width: 0;
  width: 4.5rem;
  max-width: 4.5rem;
  height: 30px;
  padding: 0 6px;
  box-sizing: border-box;
}

.b24-corr-th-edit .b24-ico {
  font-size: 14px;
}

.b24-btn-filter-icon .b24-ico,
.b24-btn-icon .b24-ico {
  font-size: 17px;
}

.b24-menu-wrap {
  position: relative;
}

.b24-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 70;
  min-width: 220px;
  padding: 6px 0;
  background: #fff;
  border: 1px solid #d3d9de;
  border-radius: 2px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.b24-menu-panel[hidden] {
  display: none !important;
}

.b24-menu-panel_start {
  right: auto;
  left: 0;
}

.b24-menu-panel__item {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  padding: 9px 14px;
  text-align: left;
  font: inherit;
  font-size: 13px;
  color: #333;
  cursor: pointer;
}

.b24-menu-panel__item:hover:not(:disabled) {
  background: #f5f7f8;
}

.b24-menu-panel__item:disabled {
  color: #a8adb3;
  cursor: default;
}

/* Поиск по правообладателю: отдельное поле с выпадающим списком результатов */
.b24-owner-search-wrap {
  position: relative;
}

.b24-owner-search-wrap[hidden] {
  display: none !important;
}

.b24-owner-search-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 70;
  min-width: 340px;
  max-width: 480px;
  max-height: 420px;
  overflow-y: auto;
  padding: 6px 0;
  background: #fff;
  border: 1px solid #d3d9de;
  border-radius: 2px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.b24-owner-search-panel[hidden] {
  display: none !important;
}

.b24-owner-search-group__title {
  padding: 7px 14px 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #7b858e;
}

.b24-owner-search-item {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  padding: 7px 14px;
  text-align: left;
  font: inherit;
  font-size: 13px;
  color: #333;
  cursor: pointer;
}

.b24-owner-search-item:hover {
  background: #f5f7f8;
}

.b24-owner-search-item__apt {
  font-weight: 600;
  margin-right: 6px;
}

.b24-owner-search-item__meta {
  display: block;
  font-size: 12px;
  color: #7b858e;
}

.b24-owner-search-empty,
.b24-owner-search-more {
  padding: 9px 14px;
  font-size: 13px;
  color: #7b858e;
}

.b24-table_selectable tbody tr {
  cursor: pointer;
}

.b24-table_selectable tbody tr.b24-row-selected {
  background: #2081b029;
}

.b24-mkd-apartment-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  padding: 8px 10px;
  border: 1px solid #dfe3e6;
  border-radius: 3px;
  background: #f8fafb;
}

.b24-mkd-apartment-context__item {
  color: #525c69;
  font-size: 13px;
  font-weight: 600;
}

#mkd-view-table tbody tr.b24-row-selected {
  background: #f2f4f5;
}

#mkd-view-table tbody tr.b24-row-active {
  box-shadow: inset 4px 0 0 #2f80ed;
  outline: 1px solid rgba(47, 128, 237, 0.35);
  outline-offset: -1px;
}

#mkd-view-table tbody tr.b24-row-active:not(.b24-row-selected) {
  background: rgba(47, 128, 237, 0.05);
}

.b24-mkd-active-badge {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 5px;
  border-radius: 8px;
  background: #e8f2ff;
  color: #2067b0;
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
}

.b24-mkd-active-badge[hidden] {
  display: none;
}

.b24-mkd-owner-link,
.b24-mkd-owner-deal-link,
.b24-mkd-create-contact,
.b24-mkd-link-contact,
.b24-mkd-sync-btn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.b24-mkd-owner-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

.b24-mkd-owner-link {
  color: #2067b0;
}

.b24-mkd-owner-link:hover,
.b24-mkd-owner-deal-link:hover,
.b24-mkd-create-contact:hover,
.b24-mkd-link-contact:hover,
.b24-mkd-sync-btn:hover {
  text-decoration: underline;
}

.b24-mkd-owner-deal-link,
.b24-mkd-create-contact,
.b24-mkd-link-contact,
.b24-mkd-sync-btn {
  color: #2067b0;
  font-size: 11px;
  text-decoration: underline;
}

.b24-mkd-link-contact-results {
  max-height: 280px;
  overflow: auto;
  margin: 10px 0 4px;
  border: 1px solid #e0e4ea;
  background: #fafbfc;
}

.b24-mkd-link-contact-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid #eef1f5;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.b24-mkd-link-contact-item:last-child {
  border-bottom: 0;
}

.b24-mkd-link-contact-item:hover {
  background: #eef5fc;
}

.b24-mkd-link-contact-item__name {
  font-weight: 600;
}

.b24-mkd-link-contact-item__meta {
  color: #6a7380;
  font-size: 12px;
  margin-top: 2px;
}

.b24-mkd-link-contact-item__id {
  flex-shrink: 0;
  color: #6a7380;
  font-size: 12px;
}

.b24-mkd-payer-uk-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.b24-mkd-uk-search-scope {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

.b24-textarea {
  min-height: 72px;
  resize: vertical;
}

.b24-textarea_filter {
  min-height: 96px;
  max-height: 180px;
  font-size: 12px;
  line-height: 1.35;
}

.b24-mkd-flags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.b24-mkd-verified-cell {
  text-align: center;
  vertical-align: middle;
}

.b24-mkd-verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}

.b24-mkd-flag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
}

.b24-mkd-flag_warn {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffe08a;
}

.b24-mkd-flag_skip {
  background: #e8f1fb;
  color: #0b5cab;
  border: 1px solid #b6d4fe;
}

.b24-mkd-flag_skip-expired {
  background: #f1f3f5;
  color: #6c757d;
  border: 1px solid #ced4da;
}

.b24-mkd-tko-panel {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border: 1px solid #c9d4e0;
  border-radius: 8px;
  background: #f7f9fc;
}

.b24-mkd-tko-panel.is-warn {
  border-color: #e0c48e;
  background: #fff8e8;
}

.b24-mkd-tko-panel__title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.b24-mkd-tko-panel__note {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #6a7685;
}

.b24-mkd-tko-panel__hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: #8a5a12;
  min-height: 1em;
}

.b24-mkd-skip-panel {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border: 1px solid #c9d4e0;
  border-radius: 8px;
  background: #f7f9fc;
}

.b24-mkd-skip-panel.is-open {
  border-color: #8eb6e0;
  background: #eef5fc;
}

.b24-mkd-skip-panel__head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.b24-mkd-skip-apt-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin: 0;
}

.b24-mkd-skip-panel__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #6a7685;
}

.b24-mkd-skip-panel__body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #d5deea;
}

.b24-mkd-access-tabs {
  display: flex;
  gap: 6px;
  margin: 12px 0 10px;
}

.b24-mkd-access-tab {
  appearance: none;
  border: 1px solid #c9d4e0;
  background: #fff;
  color: #2f3a47;
  border-radius: 6px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.b24-mkd-access-tab.is-active {
  background: #e8f1fb;
  border-color: #8eb6e0;
  color: #0b5cab;
  font-weight: 600;
}

.b24-mkd-access-create {
  margin-bottom: 10px;
}

.b24-mkd-access-create__row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.b24-mkd-access-create__row .b24-input {
  flex: 1;
  /* Длинное название группы в select не должно растягивать строку. */
  min-width: 0;
}

.b24-mkd-access-members {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.b24-mkd-access-member {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px 2px 8px;
  border-radius: 999px;
  background: #eef2f6;
  border: 1px solid #d5deea;
  font-size: 12px;
}

.b24-mkd-access-member button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #6a7685;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.b24-mkd-access-member button:hover {
  color: #b42318;
}

.b24-mkd-flag_dup {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f1aeb5;
}

.b24-mkd-dup-count {
  color: #721c24;
  font-weight: 600;
}

.b24-modal__panel_mkd-inspect-report {
  width: min(720px, 96vw);
  max-height: 86vh;
  overflow: auto;
}

.b24-mkd-inspect-report__summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}

.b24-mkd-inspect-report__card {
  border: 1px solid #e0e4ea;
  background: #fafbfc;
  padding: 8px 10px;
}

.b24-mkd-inspect-report__card-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.b24-mkd-inspect-report__card-label {
  display: block;
  margin-top: 2px;
  color: #6a7380;
  font-size: 12px;
}

.b24-mkd-inspect-report__section {
  margin: 0 0 12px;
}

.b24-mkd-inspect-report__section-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
}

.b24-mkd-inspect-report__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid #e0e4ea;
}

.b24-mkd-inspect-report__item {
  padding: 8px 10px;
  border-bottom: 1px solid #eef1f5;
  font-size: 13px;
}

.b24-mkd-inspect-report__item:last-child {
  border-bottom: 0;
}

.b24-mkd-inspect-report__kind {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
}

.b24-mkd-inspect-report__kind_created {
  background: #e7f5ea;
  color: #1e6b35;
  border: 1px solid #b7e0c2;
}

.b24-mkd-inspect-report__kind_renamed {
  background: #eef5fc;
  color: #1f5f9a;
  border: 1px solid #bfd7f0;
}

.b24-mkd-inspect-report__kind_deleted {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f1aeb5;
}

.b24-mkd-inspect-report__kind_cleared {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffe08a;
}

.b24-mkd-inspect-report__sub {
  margin-top: 2px;
  color: #6a7380;
  font-size: 12px;
}

#mkd-contact-progress-errors {
  white-space: pre-line;
}

#mkd-apt-filters-modal .b24-filter-check {
  justify-content: flex-start;
  gap: 8px;
}

#mkd-apt-filters-modal .b24-filter-check .b24-form-field__label {
  min-width: 0;
}

.b24-col-check,
.b24-col-chk {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  text-align: center;
  vertical-align: middle;
  padding-left: 10px !important;
  padding-right: 4px !important;
}

.b24-col-check input[type='checkbox'],
.b24-col-chk input[type='checkbox'] {
  cursor: pointer;
  margin: 0;
}

.b24-filter-date-label_inline {
  margin: 0;
}

.b24-filter-date-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #525c69;
}

.b24-filter-date-label__text {
  white-space: nowrap;
}

.b24-link-btn {
  border: 0;
  padding: 0;
  background: none;
  color: #2067b0;
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.b24-link-btn:hover {
  color: #0d4f8b;
}

.b24-modal__panel_compact {
  padding: 16px 18px 14px;
}

.b24-modal__panel_compact .b24-modal__title {
  font-size: 18px;
  margin-bottom: 6px;
}

.b24-accrual-doc-channels__actions .b24-link-btn {
  font-size: 12px;
  line-height: 1.2;
  text-decoration: none;
}

.b24-accrual-doc-channels__actions .b24-link-btn:hover {
  text-decoration: underline;
}

.b24-filter-panel_mkd {
  left: 0;
  right: auto;
  min-width: 280px;
  max-width: min(360px, calc(100vw - 16px));
  max-height: min(85vh, 640px);
  padding: 12px 14px;
  overflow: auto;
  z-index: 200;
}

.b24-filter-panel_mkd.is-fixed {
  position: fixed;
  top: auto;
  left: auto;
  right: auto;
}

.b24-filter-panel_mkd .b24-filter-panel__toolbar {
  margin: 4px 0 0;
}

.b24-mkd-th-sort {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.b24-mkd-th-sort:hover {
  color: #2066b0;
  background: #eef5fb;
}

.b24-mkd-th-sort.is-sorted {
  color: #2066b0;
  background: #e8f2fb;
}

.b24-mkd-th-sort__mark {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  line-height: 1;
  opacity: 0.85;
}

.b24-mkd-filter-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
}

.b24-mkd-receipt-status-list {
  max-height: none;
  margin-top: 2px;
}

.b24-mkd-receipt-status-list label {
  font-size: 13px;
  line-height: 1.35;
}

.b24-mkd-stats {
  margin: 0 16px 12px;
  padding: 0 0 4px;
  border: none;
  background: transparent;
}

.b24-mkd-stats[hidden] {
  display: none !important;
}

.b24-mkd-stats__head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
}

.b24-mkd-stats__head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.b24-mkd-stats__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.b24-mkd-stats__empty {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
}

#mkd-btn-stats-refresh.b24-btn-stats-stale:not(:disabled) {
  color: #2fc6f6;
  border-color: #2fc6f6;
  background: #eef9fd;
  font-weight: 600;
  opacity: 1;
}

#mkd-btn-stats-refresh:disabled {
  opacity: 0.55;
  cursor: default;
}

.b24-mkd-stats__title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.b24-mkd-stats__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.b24-mkd-stats__section {
  grid-column: 1 / -1;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #868d95;
}

.b24-mkd-stats__card {
  padding: 8px 10px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #e6eaed;
  min-height: 58px;
}

.b24-mkd-stats__value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: #333;
}

.b24-mkd-stats__card_ok .b24-mkd-stats__value {
  color: #1a9e5c;
}

.b24-mkd-stats__card_warn .b24-mkd-stats__value {
  color: #c48a00;
}

.b24-mkd-stats__card_err .b24-mkd-stats__value {
  color: #d64545;
}

.b24-mkd-stats__label {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  color: #6a737d;
}

.b24-mkd-receipt-registry-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: max-content;
  max-width: 14rem;
}

.b24-mkd-receipt-registry-cell__btn {
  flex: 0 0 auto;
}

.b24-mkd-receipt-last {
  margin-top: 0;
  font-size: 11px;
  line-height: 1.3;
  max-width: 100%;
}

.b24-mkd-receipt-last__line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.b24-table thead th.b24-num {
  text-align: right;
}

#mkd-view-modal .b24-modal__panel.b24-modal__panel_mkd-view {
  width: min(98vw, 1280px);
  max-width: 1280px;
  max-height: 92vh;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

#mkd-apartment-edit-modal .b24-modal__panel,
#mkd-building-edit-modal .b24-modal__panel {
  width: min(96vw, 780px);
  max-width: 780px;
  max-height: 90vh;
  overflow: auto;
}

#mkd-misplaced-modal .b24-modal__panel.b24-modal__panel_mkd-misplaced {
  width: min(98vw, 1100px);
  max-width: 1100px;
  max-height: 92vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

#mkd-receipt-registry-modal .b24-modal__panel.b24-modal__panel_mkd-receipt-registry {
  width: min(96vw, 760px);
  max-width: 760px;
  max-height: 90vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

#mkd-receipt-amounts-modal .b24-modal__panel.b24-modal__panel_mkd-receipt-amounts {
  width: min(98vw, 1200px);
  max-width: 1200px;
  max-height: 92vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

#mkd-receipt-amounts-modal .b24-mkd-receipt-amounts-filters {
  margin-bottom: 8px;
}

#mkd-receipt-amounts-modal .b24-mkd-receipt-amounts-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

#mkd-receipt-amounts-modal .b24-table-wrap_modal {
  flex: 1 1 auto;
  min-height: 160px;
  overflow: auto;
}

#mkd-receipt-amounts-modal .b24-table td.b24-num,
#mkd-receipt-amounts-modal .b24-table th.b24-num {
  text-align: right;
  white-space: nowrap;
}

#mkd-receipt-registry-modal .b24-modal__title {
  font-size: 16px;
  margin-bottom: 4px;
}

#mkd-receipt-registry-modal .b24-meta {
  font-size: 12px;
  margin-bottom: 6px;
}

#mkd-receipt-registry-modal .b24-table-wrap_modal {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: min(52vh, 420px);
  overflow: auto;
  border: 1px solid #dfe3e6;
  border-radius: 2px;
  margin: 6px 0 4px;
}

#mkd-receipt-registry-modal .b24-table {
  font-size: 12px;
  line-height: 1.3;
}

#mkd-receipt-registry-modal .b24-table th,
#mkd-receipt-registry-modal .b24-table td {
  padding: 4px 6px;
  vertical-align: middle;
}

#mkd-receipt-registry-modal .b24-table-wrap_modal thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5f7f8;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

#mkd-receipt-registry-modal .b24-actions-cell {
  width: 1%;
  padding-right: 4px;
}

#mkd-receipt-registry-modal .b24-modal__actions {
  margin-top: 8px;
}

#mkd-receipt-registry-modal .b24-modal__actions .b24-btn {
  padding: 5px 12px;
  font-size: 12px;
}

#mkd-misplaced-modal .b24-table-wrap_modal {
  flex: 1 1 auto;
  min-height: 180px;
  max-height: min(60vh, 560px);
  overflow: auto;
  border: 1px solid #dfe3e6;
  border-radius: 2px;
  margin: 10px 0 4px;
}

#mkd-misplaced-modal .b24-table-wrap_modal thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5f7f8;
  box-shadow: 0 1px 0 #dfe3e6;
}

#mkd-misplaced-modal .b24-table td {
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

#mkd-view-modal .b24-table-wrap_modal {
  flex: 1 1 auto;
  min-height: 200px;
  max-height: min(62vh, 640px);
  overflow: auto;
  border: 1px solid #dfe3e6;
  border-radius: 2px;
  -webkit-overflow-scrolling: touch;
}

#mkd-view-modal .b24-table-wrap_modal .b24-table {
  min-width: 1100px;
}

#mkd-view-modal .b24-table-wrap_modal thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5f7f8;
  box-shadow: 0 1px 0 #dfe3e6;
}

.b24-toolbar_mkd-view {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  position: relative;
  z-index: 4;
  overflow: visible;
}

#mkd-view-modal .b24-col-picker-wrap {
  z-index: 5;
}

#mkd-view-modal .b24-col-picker-wrap .b24-columns-panel:not(.is-fixed) {
  left: auto;
  right: 0;
}

#mkd-view-modal .b24-columns-panel.is-fixed {
  z-index: 1100;
}

.b24-mkd-view-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex: 0 0 auto;
  margin-top: 4px;
}

.b24-mkd-view-footer #mkd-view-pager-status {
  margin: 0;
}

.b24-mkd-view-footer .b24-link-btn {
  margin-left: auto;
  white-space: nowrap;
}

.b24-modal__panel_mkd-import {
  max-width: 640px;
}

.b24-modal__panel_mkd-receipts {
  max-width: 630px;
}

.b24-modal__panel_mkd-receipt-preview {
  max-width: 920px;
}

.b24-mkd-receipt-preview {
  margin-top: 14px;
  padding: 16px 18px 18px;
  border: 1px solid #cfd6db;
  border-radius: 2px;
  background: #fff;
  font-size: 12px;
  line-height: 1.4;
  color: #222;
}

.b24-mkd-receipt-preview__envelope {
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e4e8eb;
}

.b24-mkd-receipt-preview__envelope-label {
  margin: 0 0 4px;
  font-size: 11px;
  color: #525c69;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.b24-mkd-receipt-preview__envelope-value {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.b24-mkd-receipt-preview__doc-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.b24-mkd-receipt-preview__doc-sub {
  margin: 0 0 14px;
  text-align: center;
  color: #525c69;
  font-size: 12px;
}

.b24-mkd-receipt-preview__section-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.b24-mkd-receipt-preview__payer {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 4px 10px;
  margin-bottom: 14px;
}

.b24-mkd-receipt-preview__payer-label {
  color: #525c69;
}

.b24-mkd-receipt-preview__payer-value {
  word-break: break-word;
}

.b24-mkd-receipt-preview__table-wrap {
  overflow-x: auto;
  margin-bottom: 10px;
}

.b24-mkd-receipt-preview__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.b24-mkd-receipt-preview__table th,
.b24-mkd-receipt-preview__table td {
  border: 1px solid #cfd6db;
  padding: 5px 6px;
  vertical-align: top;
}

.b24-mkd-receipt-preview__table th {
  background: #f4f6f8;
  font-weight: 600;
  text-align: center;
}

.b24-mkd-receipt-preview__table td.b24-num {
  text-align: right;
  white-space: nowrap;
}

.b24-mkd-receipt-preview__sum-pay {
  margin: 0 0 12px;
  font-size: 13px;
}

.b24-mkd-receipt-preview__sum-pay strong {
  font-size: 14px;
}

.b24-mkd-receipt-preview__ref {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.b24-mkd-receipt-preview__ref-item {
  border: 1px solid #dfe3e6;
  background: #f8fafb;
  padding: 8px;
}

.b24-mkd-receipt-preview__ref-label {
  display: block;
  margin-bottom: 4px;
  color: #525c69;
  font-size: 10px;
  line-height: 1.3;
}

.b24-mkd-receipt-preview__ref-value {
  font-weight: 600;
  font-size: 13px;
}

.b24-mkd-receipt-preview__last-pay {
  margin: 0 0 12px;
  font-size: 13px;
}

.b24-mkd-receipt-preview__footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid #e4e8eb;
}

.b24-mkd-receipt-preview__footer-main {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
}

.b24-mkd-receipt-preview__grand {
  font-size: 14px;
  font-weight: 700;
}

.b24-mkd-receipt-preview__scan-cta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 45%;
  text-align: right;
}

.b24-mkd-receipt-preview__scan-title {
  color: #1e8f4a;
  font-size: 18px;
  font-weight: 700;
  font-style: italic;
  line-height: 1.15;
}

.b24-mkd-receipt-preview__scan-note {
  color: #525c69;
  font-size: 12px;
}

.b24-mkd-receipt-preview__pay-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: 65%;
  font-size: 11px;
  color: #525c69;
  word-break: break-all;
}

.b24-mkd-receipt-preview__pay-link a {
  color: #2067b0;
}

.b24-mkd-copy-btn {
  flex-shrink: 0;
  padding: 2px 8px;
  border: 1px solid #c9d0d6;
  border-radius: 2px;
  background: #fff;
  color: #333;
  font-size: 11px;
  cursor: pointer;
}

.b24-mkd-copy-btn:hover {
  border-color: #2fc6f6;
}

.b24-mkd-exclude-wrap {
  margin: 4px 0 10px;
}

.b24-mkd-receipt-layout {
  margin: 8px 0 12px;
}

.b24-mkd-receipt-layout__panel {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #dfe3e6;
  border-radius: 2px;
  background: #f8fafb;
  display: grid;
  gap: 10px;
}

.b24-link-btn {
  display: inline-block;
  padding: 0;
  border: 0;
  background: none;
  color: #2067b0;
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.b24-link-btn:hover {
  color: #154a80;
}

.b24-mkd-exclude-panel {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #dfe3e6;
  border-radius: 2px;
  background: #f8fafb;
}

@media (max-width: 720px) {
  .b24-mkd-receipt-preview__ref {
    grid-template-columns: 1fr 1fr;
  }
  .b24-mkd-receipt-preview__footer-main {
    flex-direction: column;
    align-items: stretch;
  }
  .b24-mkd-receipt-preview__scan-cta {
    max-width: none;
    text-align: left;
  }
  .b24-mkd-receipt-preview__footer {
    flex-direction: column;
    align-items: stretch;
  }
  .b24-mkd-receipt-preview__pay-link {
    max-width: none;
  }
}

#mkd-access-settings-modal .b24-modal__panel.b24-modal__panel_mkd-access {
  width: min(980px, 96vw);
  max-width: 980px;
  max-height: min(90vh, 860px);
  height: auto;
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 0;
}

#mkd-access-settings-modal .b24-mkd-access-modal__top {
  margin-bottom: 0;
}

#mkd-access-settings-modal .b24-mkd-access-modal__hint {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.4;
  color: #5b6570;
}

#mkd-access-settings-modal #mkd-access-user-results {
  max-height: 120px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  overflow: auto;
}

#mkd-access-settings-modal #mkd-access-user-results:empty {
  display: none !important;
}

#mkd-access-settings-modal #mkd-access-user-results:not(:empty) {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid #e5e9ee;
  border-radius: 6px;
  background: #f8fafb;
}

#mkd-access-settings-modal .b24-mkd-access-rules {
  margin: 10px 0 12px;
  padding: 0;
  overflow: visible;
  max-height: none;
}

#mkd-access-settings-modal .b24-mkd-access-modal__bottom {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 0 -22px;
  padding: 12px 22px 16px;
  border-top: 1px solid #e8ecf0;
  background: #fff;
  box-shadow: 0 -6px 12px -8px rgba(16, 24, 40, 0.12);
}

#mkd-access-settings-modal .b24-modal__actions {
  margin-top: 0;
}

#mkd-access-settings-modal #mkd-access-err {
  margin: 0 0 8px;
}

.b24-mkd-access-rules {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.b24-mkd-access-rule {
  padding: 0;
  border: 1px solid #d5dbe0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
  overflow: visible;
}

.b24-mkd-access-rule__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 14px 14px;
  border-bottom: 0;
  background: #fafbfc;
  box-sizing: border-box;
}

.b24-mkd-access-rule.is-expanded .b24-mkd-access-rule__head {
  border-bottom: 1px solid #eef1f3;
}

.b24-mkd-access-rule__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.b24-mkd-access-rule__toggle:hover .b24-mkd-access-rule__name {
  color: #1d4ed8;
}

.b24-mkd-access-rule__chevron {
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  margin: 0;
  border-right: 1.5px solid #6b7280;
  border-bottom: 1.5px solid #6b7280;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.b24-mkd-access-rule.is-expanded .b24-mkd-access-rule__chevron {
  transform: rotate(45deg);
}

.b24-mkd-access-rule__toggle-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 1px 0;
}

.b24-mkd-access-rule__name {
  font-weight: 650;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.b24-mkd-access-rule__summary {
  font-size: 12px;
  line-height: 1.35;
  color: #6b7280;
}

.b24-mkd-access-rule.is-expanded .b24-mkd-access-rule__summary {
  display: none;
}

.b24-mkd-access-rule__body {
  padding: 10px 12px 12px;
}

.b24-mkd-access-rule__section {
  margin-bottom: 10px;
}

.b24-mkd-access-rule__section-title {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.b24-mkd-access-rule__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #e8ecf0;
  border-radius: 6px;
  background: #fafbfc;
}

.b24-mkd-access-rule__cols label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.b24-mkd-access-rule__group {
  margin-top: 10px;
  padding: 10px 12px 8px;
  border: 1px solid #e5e9ee;
  border-radius: 8px;
  background: #f8fafb;
}

.b24-mkd-access-rule__group_accent {
  border-color: #c5d4e8;
  background: #f3f7fc;
  box-shadow: inset 3px 0 0 #3b82f6;
}

.b24-mkd-access-rule__group-head {
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(16, 24, 40, 0.06);
}

.b24-mkd-access-rule__group-title {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
}

.b24-mkd-access-rule__group-hint {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: #6b7280;
}

.b24-mkd-access-rule__perms {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2px 14px;
}

.b24-mkd-access-rule__perms label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 5px 2px;
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
}

.b24-mkd-access-rule__manage {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px dashed #d7dee6;
  border-radius: 6px;
  background: #fafbfc;
  font-size: 13px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .b24-mkd-access-rule__perms {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .b24-mkd-access-rule__cols,
  .b24-mkd-access-rule__perms {
    grid-template-columns: 1fr;
  }
}

.b24-progress {
  height: 8px;
  margin: 16px 0 10px;
  background: #e8ecef;
  border-radius: 4px;
  overflow: hidden;
}

.b24-progress__bar {
  height: 100%;
  width: 0;
  background: #2fc6f6;
  border-radius: 4px;
  transition: width 0.25s ease;
}

.b24-progress__bar_indeterminate {
  width: 40%;
  animation: b24-progress-indeterminate 1.2s ease-in-out infinite;
}

@keyframes b24-progress-indeterminate {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.b24-mkd-import-options {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #dfe3e6;
  border-radius: 2px;
  background: #f8fafb;
}

.b24-mkd-import-options .b24-form-grid {
  margin-top: 8px;
}

.b24-mkd-import-exclude {
  margin-top: 12px;
}

.b24-mkd-import-exclude .b24-field__label {
  display: block;
  margin-bottom: 4px;
}

.b24-mkd-import-exclude .b24-meta {
  margin: 0 0 8px;
}

/* --- Разбор сводной перед импортом --- */
.b24-mkd-import-analysis {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #dfe3e6;
  border-radius: 2px;
  background: #fbfcfd;
}

.b24-mkd-import-analysis__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.b24-mkd-import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.b24-mkd-import-summary__item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid #dfe3e6;
  border-radius: 2px;
  background: #fff;
  font-size: 12px;
}

.b24-mkd-import-summary__item_accent {
  border-color: #b5abfc;
  background: #f5f4ff;
}

.b24-mkd-import-summary__label {
  color: #75798c;
}

.b24-mkd-import-summary__value {
  font-weight: 600;
}

.b24-mkd-import-issue {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 3px solid #cfd6db;
  background: #fff;
}

.b24-mkd-import-issue_error {
  border-left-color: #a94442;
  background: #fdeaea;
}

.b24-mkd-import-issue_warn {
  border-left-color: #d0a13a;
  background: #fdf7e7;
}

.b24-mkd-import-issue_info {
  border-left-color: #7972a9;
  background: #f5f4ff;
}

.b24-mkd-import-issue__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.b24-mkd-import-issue__title {
  font-weight: 600;
}

.b24-mkd-import-issue__count {
  color: #75798c;
  font-size: 12px;
  white-space: nowrap;
}

.b24-mkd-import-samples {
  margin-top: 6px;
  font-size: 12px;
}

.b24-mkd-import-samples summary {
  cursor: pointer;
  color: #5d5294;
}

.b24-mkd-import-samples ul {
  margin: 4px 0 0;
  padding-left: 18px;
  max-height: 160px;
  overflow-y: auto;
  color: #595d6c;
}

.b24-mkd-import-fixes {
  margin-top: 12px;
}

.b24-mkd-import-fixes__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}

.b24-mkd-import-fix {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  margin-top: 6px;
  border: 1px solid #dfe3e6;
  border-radius: 2px;
  background: #fff;
  cursor: pointer;
}

.b24-mkd-import-fix:hover {
  border-color: #b5abfc;
}

.b24-mkd-import-fix input {
  margin-top: 3px;
}

.b24-mkd-import-fix__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.b24-mkd-import-fix__title {
  font-weight: 600;
}

.b24-mkd-import-fix__meta {
  color: #75798c;
  font-size: 12px;
}

.b24-mkd-import-export {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e4e7f5;
}

.b24-mkd-import-export__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.b24-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin-bottom: 12px;
}

.b24-form-grid .b24-field_full {
  grid-column: 1 / -1;
}

label.b24-form-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.b24-form-field__label {
  flex: 0 0 auto;
  min-width: 120px;
  color: #525c69;
  font-size: 13px;
}

label.b24-form-field .b24-input {
  flex: 1 1 auto;
  min-width: 0;
}

.b24-form-field_full {
  grid-column: 1 / -1;
}

.b24-form-field_col2 {
  grid-column: 2;
}

@media (max-width: 720px) {
  .b24-form-grid {
    grid-template-columns: 1fr;
  }

  .b24-form-field_col2 {
    grid-column: 1;
  }

  label.b24-form-field {
    flex-direction: column;
    align-items: stretch;
  }

  .b24-form-field__label {
    min-width: 0;
  }
}

.b24-toolbar_mkd .b24-bulk-actions,
.b24-toolbar_mkd-view .b24-bulk-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.b24-bulk-actions__hint {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 520px;
  line-height: 1.35;
}

.b24-toolbar_mkd .b24-bulk-actions[hidden],
.b24-toolbar_mkd-view .b24-bulk-actions[hidden] {
  display: none !important;
}

.b24-toolbar_mkd {
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 0;
  padding: 8px 16px;
}

.b24-mkd-root .b24-table {
  border-collapse: separate;
  border-spacing: 0;
}

.b24-mkd-root .b24-table thead th.b24-col-chk,
.b24-mkd-root .b24-table tbody td.b24-col-chk:first-child,
.b24-mkd-root .b24-table .b24-col-sticky {
  position: sticky;
  background-clip: padding-box;
}

.b24-mkd-root .b24-table thead th.b24-col-chk,
.b24-mkd-root .b24-table tbody td.b24-col-chk:first-child {
  left: 0;
  z-index: 4;
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  box-sizing: border-box;
  background-color: #fff;
}

.b24-mkd-root .b24-table .b24-col-sticky {
  left: 36px;
  z-index: 3;
  min-width: 11.5rem;
  max-width: 16rem;
  background-color: #fff;
  /* inset-линия не «съедается» соседними ячейками при скролле */
  box-shadow:
    inset -1px 0 0 #9aa5b5,
    6px 0 10px -4px rgba(16, 24, 40, 0.12);
}

.b24-mkd-root .b24-table tbody td.b24-col-chk:first-child,
.b24-mkd-root .b24-table tbody td.b24-col-sticky {
  /* как у остальных td: иначе linear-gradient на sticky срабатывает сразу */
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.b24-mkd-root .b24-table thead th.b24-col-chk,
.b24-mkd-root .b24-table thead th.b24-col-sticky {
  z-index: 5;
  background: #f5f7f8;
}

.b24-mkd-root .b24-table thead th.b24-col-chk {
  box-shadow: 0 1px 0 #dfe3e6;
}

.b24-mkd-root .b24-table thead th.b24-col-sticky {
  box-shadow:
    inset -1px 0 0 #8793a4,
    6px 0 10px -4px rgba(16, 24, 40, 0.14),
    0 1px 0 #dfe3e6;
}

.b24-mkd-root .b24-table tbody tr:hover td,
.b24-mkd-root .b24-table tbody tr:has(> td:first-child input[type="checkbox"]:checked) td,
.b24-mkd-root .b24-table tbody tr.b24-row-selected td,
.b24-mkd-root .b24-table tbody tr:hover td.b24-col-chk:first-child,
.b24-mkd-root .b24-table tbody tr:hover .b24-col-sticky,
.b24-mkd-root .b24-table tbody tr:has(> td:first-child input[type="checkbox"]:checked) td.b24-col-chk:first-child,
.b24-mkd-root .b24-table tbody tr:has(> td:first-child input[type="checkbox"]:checked) .b24-col-sticky,
.b24-mkd-root .b24-table tbody tr.b24-row-selected td.b24-col-chk:first-child,
.b24-mkd-root .b24-table tbody tr.b24-row-selected .b24-col-sticky {
  /* непрозрачный эквивалент #2081b029 по белому — иначе градиент не анимируется */
  background-color: #dbebf2;
}

.b24-mkd-root .b24-table thead th.is-sorted,
.b24-mkd-root .b24-table thead th.b24-col-sticky.is-sorted {
  color: #2066b0;
  background: #e8f2fb;
}

.b24-mkd-root .b24-table tbody td.is-sorted,
.b24-mkd-root .b24-table tbody td.b24-col-sticky.is-sorted {
  background-color: #eef5fb;
}

.b24-mkd-root .b24-table tbody tr:hover td.is-sorted,
.b24-mkd-root .b24-table tbody tr:has(> td:first-child input[type="checkbox"]:checked) td.is-sorted,
.b24-mkd-root .b24-table tbody tr.b24-row-selected td.is-sorted,
.b24-mkd-root .b24-table tbody tr:hover td.b24-col-sticky.is-sorted,
.b24-mkd-root .b24-table tbody tr:has(> td:first-child input[type="checkbox"]:checked) td.b24-col-sticky.is-sorted,
.b24-mkd-root .b24-table tbody tr.b24-row-selected td.b24-col-sticky.is-sorted {
  background-color: #dbebf2;
}

.b24-mkd-root .b24-table th.b24-num,
.b24-mkd-root .b24-table td.b24-num {
  text-align: right;
  white-space: nowrap;
  width: 1%;
  max-width: none;
  padding-left: 6px;
  padding-right: 8px;
}

.b24-mkd-root .b24-table th.b24-col-narrow,
.b24-mkd-root .b24-table td.b24-col-narrow {
  width: 3.5rem;
  min-width: 3rem;
  max-width: 4.5rem;
  padding-left: 4px;
  padding-right: 6px;
}

.b24-mkd-root .b24-table th.b24-col-receipt-registry,
.b24-mkd-root .b24-table td.b24-col-receipt-registry {
  width: 1%;
  white-space: nowrap;
  vertical-align: top;
}

.b24-mkd-root .b24-table th.b24-col-uk,
.b24-mkd-root .b24-table td.b24-col-uk {
  min-width: 10rem;
  max-width: 16rem;
  white-space: normal;
  text-align: center;
  font-size: 12px;
}

.b24-mkd-root .b24-table th.b24-col-comment,
.b24-mkd-root .b24-table td.b24-col-comment {
  min-width: 8rem;
  max-width: 14rem;
  white-space: normal;
  text-align: center;
  font-size: 12px;
}

.b24-toolbar_mkd-view .b24-toolbar-search {
  flex: 1 1 220px;
  min-width: 180px;
}

.b24-mkd-registry-details {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #dfe3e6;
  border-radius: 6px;
  background: #f8fafb;
}

.b24-mkd-registry-details__title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
}

.b24-mkd-registry-details__body p {
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 1.35;
}

.b24-mkd-registry-details__body p:last-child {
  margin-bottom: 0;
}

.b24-actions-cell {
  white-space: nowrap;
}

.b24-mkd-registry-icon-btn {
  min-width: 24px;
  height: 24px;
  padding: 2px;
  vertical-align: middle;
}

.b24-mkd-registry-icon-btn .b24-ico {
  font-size: 14px;
}

.b24-mkd-registry-icon-btn.is-active {
  background: #eef2f5;
}

#mkd-receipt-registry-modal .b24-input_compact {
  min-width: 0;
  width: 100%;
  max-width: 148px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.3;
  height: 24px;
}

.b24-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.b24-field__label {
  color: #525c69;
  font-size: 13px;
}

/* Иконки Phosphor: размер задаётся кеглем, а не width/height */
.b24-ico {
  display: inline-block;
  flex: 0 0 auto;
  font-size: 16px;
  line-height: 1;
}

/* Nocturne: sticky первые столбцы (чекбокс + кадастр) */
.b24-mkd-root.is-theme-nocturne .b24-table tbody td.b24-col-chk:first-child,
.b24-mkd-root.is-theme-nocturne .b24-table tbody td.b24-col-sticky,
.b24-mkd-root.is-theme-nocturne .b24-table thead th.b24-col-chk,
.b24-mkd-root.is-theme-nocturne .b24-table thead th.b24-col-sticky {
  background-color: var(--noct-surface);
}

.b24-mkd-root.is-theme-nocturne .b24-table thead th.b24-col-chk {
  box-shadow: 0 1px 0 color-mix(in srgb, var(--noct-text) 12%, transparent);
}

.b24-mkd-root.is-theme-nocturne .b24-table thead th.b24-col-sticky,
.b24-mkd-root.is-theme-nocturne .b24-table tbody td.b24-col-sticky {
  box-shadow:
    inset -1px 0 0 color-mix(in srgb, var(--noct-text) 12%, transparent),
    6px 0 10px -4px rgba(0, 0, 0, 0.28);
}

.b24-mkd-root.is-theme-nocturne .b24-table tbody tr:hover td,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr:has(> td:first-child input[type="checkbox"]:checked) td,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr.b24-row-selected td,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr:hover td.b24-col-chk:first-child,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr:hover td.b24-col-sticky,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr:has(> td:first-child input[type="checkbox"]:checked) td.b24-col-chk:first-child,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr:has(> td:first-child input[type="checkbox"]:checked) td.b24-col-sticky,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr.b24-row-selected td.b24-col-chk:first-child,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr.b24-row-selected td.b24-col-sticky {
  background-color: color-mix(in srgb, var(--noct-text) 6%, transparent);
}

.b24-mkd-root.is-theme-nocturne .b24-table thead th.is-sorted,
.b24-mkd-root.is-theme-nocturne .b24-table thead th.b24-col-sticky.is-sorted {
  color: var(--noct-accent);
  background: color-mix(in srgb, var(--noct-accent) 18%, var(--noct-surface));
}

.b24-mkd-root.is-theme-nocturne .b24-table tbody td.is-sorted,
.b24-mkd-root.is-theme-nocturne .b24-table tbody td.b24-col-sticky.is-sorted {
  background-color: color-mix(in srgb, var(--noct-accent) 14%, var(--noct-surface));
}

.b24-mkd-root.is-theme-nocturne .b24-table tbody tr:hover td.is-sorted,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr:has(> td:first-child input[type="checkbox"]:checked) td.is-sorted,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr.b24-row-selected td.is-sorted,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr:hover td.b24-col-sticky.is-sorted,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr:has(> td:first-child input[type="checkbox"]:checked) td.b24-col-sticky.is-sorted,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr.b24-row-selected td.b24-col-sticky.is-sorted {
  background-color: color-mix(in srgb, var(--noct-accent) 22%, var(--noct-surface));
}

/* Nocturne: выпадающие меню «Ещё» / «Проблемные данные» */
.b24-mkd-root.is-theme-nocturne .b24-menu-panel {
  background: var(--noct-surface);
  border-color: var(--noct-divider);
  box-shadow: var(--noct-shadow-md);
  border-radius: 10px;
}

.b24-mkd-root.is-theme-nocturne .b24-menu-panel__item {
  color: var(--noct-text);
}

.b24-mkd-root.is-theme-nocturne .b24-menu-panel__item:hover:not(:disabled) {
  background: color-mix(in srgb, var(--noct-text) 6%, transparent);
}

.b24-mkd-root.is-theme-nocturne .b24-menu-panel__item:disabled {
  color: var(--noct-neutral-500);
  opacity: 0.6;
}

/* Nocturne: выпадашка поиска по правообладателю */
.b24-mkd-root.is-theme-nocturne .b24-owner-search-panel {
  background: var(--noct-surface);
  border-color: var(--noct-divider);
  box-shadow: var(--noct-shadow-md);
  border-radius: 10px;
}

.b24-mkd-root.is-theme-nocturne .b24-owner-search-item {
  color: var(--noct-text);
}

.b24-mkd-root.is-theme-nocturne .b24-owner-search-item:hover {
  background: color-mix(in srgb, var(--noct-text) 6%, transparent);
}

.b24-mkd-root.is-theme-nocturne .b24-owner-search-group__title,
.b24-mkd-root.is-theme-nocturne .b24-owner-search-item__meta,
.b24-mkd-root.is-theme-nocturne .b24-owner-search-empty,
.b24-mkd-root.is-theme-nocturne .b24-owner-search-more {
  color: var(--noct-neutral-500);
}

/* Nocturne: панель статистики */
.b24-mkd-root.is-theme-nocturne .b24-mkd-stats {
  background: transparent;
  border: none;
}

.b24-mkd-root.is-theme-nocturne .b24-mkd-stats__title {
  color: var(--noct-text);
}

.b24-mkd-root.is-theme-nocturne .b24-mkd-stats__section {
  color: var(--noct-neutral-500);
}

.b24-mkd-root.is-theme-nocturne .b24-mkd-stats__card {
  background: var(--noct-surface);
  border-color: var(--noct-divider);
}

.b24-mkd-root.is-theme-nocturne .b24-mkd-stats__value {
  color: var(--noct-text);
}

.b24-mkd-root.is-theme-nocturne .b24-mkd-stats__card_ok .b24-mkd-stats__value {
  color: var(--noct-ok);
}

.b24-mkd-root.is-theme-nocturne .b24-mkd-stats__card_warn .b24-mkd-stats__value {
  color: var(--noct-warn);
}

.b24-mkd-root.is-theme-nocturne .b24-mkd-stats__card_err .b24-mkd-stats__value {
  color: var(--noct-err);
}

.b24-mkd-root.is-theme-nocturne .b24-mkd-stats__label,
.b24-mkd-root.is-theme-nocturne .b24-mkd-stats__empty {
  color: var(--noct-neutral-500);
}

.b24-mkd-root.is-theme-nocturne #mkd-btn-stats-refresh.b24-btn-stats-stale:not(:disabled) {
  color: var(--noct-accent);
  border-color: var(--noct-accent);
  background: color-mix(in srgb, var(--noct-accent) 16%, transparent);
}

.b24-mkd-root.is-theme-nocturne .b24-mkd-filter-check {
  color: var(--noct-text);
}

/* Nocturne: модалка «Доступ к данным МКД» (вне .b24-mkd-root) */
body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-modal__hint {
  color: var(--noct-neutral-500);
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-tab {
  background: color-mix(in srgb, var(--noct-text) 4%, transparent);
  border-color: var(--noct-divider);
  color: var(--noct-neutral-500);
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-tab.is-active {
  background: color-mix(in srgb, var(--noct-accent) 16%, transparent);
  border-color: color-mix(in srgb, var(--noct-accent) 45%, transparent);
  color: var(--noct-text);
  font-weight: 600;
}

body.is-theme-nocturne #mkd-access-settings-modal #mkd-access-user-results:not(:empty) {
  background: color-mix(in srgb, var(--noct-text) 4%, transparent);
  border-color: var(--noct-divider);
}

body.is-theme-nocturne #mkd-access-settings-modal #mkd-access-user-results label {
  color: var(--noct-text);
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-form-field__label {
  color: var(--noct-neutral-500);
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-modal__bottom {
  background: var(--noct-surface);
  border-top-color: var(--noct-divider);
  box-shadow: 0 -8px 20px -10px rgba(0, 0, 0, 0.45);
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule {
  background: color-mix(in srgb, var(--noct-text) 3%, transparent);
  border-color: var(--noct-divider);
  box-shadow: none;
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule__head {
  background: color-mix(in srgb, var(--noct-text) 4%, transparent);
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule.is-expanded .b24-mkd-access-rule__head {
  border-bottom-color: var(--noct-divider);
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule__toggle:hover .b24-mkd-access-rule__name {
  color: #b8aef0;
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule__chevron {
  border-right-color: var(--noct-neutral-500);
  border-bottom-color: var(--noct-neutral-500);
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule__name,
body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule__group-title {
  color: var(--noct-text);
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule__summary,
body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule__section-title,
body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule__group-hint {
  color: var(--noct-neutral-500);
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule__cols {
  background: color-mix(in srgb, var(--noct-text) 4%, transparent);
  border-color: var(--noct-divider);
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule__cols label,
body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule__perms label,
body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule__manage {
  color: var(--noct-text);
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule__group {
  background: color-mix(in srgb, var(--noct-text) 4%, transparent);
  border-color: var(--noct-divider);
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule__group_accent {
  border-color: color-mix(in srgb, var(--noct-accent) 45%, transparent);
  background: color-mix(in srgb, var(--noct-accent) 10%, transparent);
  box-shadow: inset 3px 0 0 var(--noct-accent);
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule__group-head {
  border-bottom-color: var(--noct-divider);
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule__manage {
  background: color-mix(in srgb, var(--noct-text) 4%, transparent);
  border-color: var(--noct-divider);
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-member {
  background: color-mix(in srgb, var(--noct-accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--noct-accent) 35%, transparent);
  color: var(--noct-text);
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-member button {
  color: var(--noct-neutral-500);
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-member button:hover {
  color: #f5a8a8;
}

body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rules,
body.is-theme-nocturne #mkd-access-settings-modal .b24-mkd-access-rule__body {
  color: var(--noct-text);
}

/* Nocturne: открытый МКД и карточка квартиры (модалки вне .b24-mkd-root) */
body.is-theme-nocturne .b24-mkd-apartment-context,
body.is-theme-nocturne .b24-mkd-tko-panel,
body.is-theme-nocturne .b24-mkd-skip-panel {
  background: var(--noct-bg);
  border-color: var(--noct-divider);
}

body.is-theme-nocturne .b24-mkd-apartment-context__item,
body.is-theme-nocturne .b24-mkd-tko-panel__title,
body.is-theme-nocturne .b24-mkd-skip-apt-check {
  color: var(--noct-text);
}

body.is-theme-nocturne .b24-mkd-tko-panel__note,
body.is-theme-nocturne .b24-mkd-skip-panel__hint {
  color: var(--noct-neutral-500);
}

body.is-theme-nocturne .b24-mkd-tko-panel.is-warn {
  background: color-mix(in srgb, var(--noct-warn) 14%, transparent);
  border-color: color-mix(in srgb, var(--noct-warn) 45%, transparent);
}

body.is-theme-nocturne .b24-mkd-tko-panel__hint {
  color: var(--noct-warn);
}

body.is-theme-nocturne .b24-mkd-skip-panel.is-open {
  border-color: color-mix(in srgb, var(--noct-accent) 45%, transparent);
}

body.is-theme-nocturne .b24-mkd-skip-panel__body {
  border-top-color: var(--noct-divider);
}

body.is-theme-nocturne .b24-mkd-active-badge {
  background: color-mix(in srgb, var(--noct-accent) 18%, transparent);
  color: var(--noct-accent);
}

body.is-theme-nocturne #mkd-view-modal .b24-table-wrap_modal,
body.is-theme-nocturne #mkd-receipt-registry-modal .b24-table-wrap_modal,
body.is-theme-nocturne #mkd-misplaced-modal .b24-table-wrap_modal,
body.is-theme-nocturne #mkd-receipt-amounts-modal .b24-table-wrap_modal {
  background: var(--noct-bg);
  border-color: var(--noct-divider);
}

body.is-theme-nocturne #mkd-view-modal .b24-table-wrap_modal thead th,
body.is-theme-nocturne #mkd-receipt-registry-modal .b24-table-wrap_modal thead th,
body.is-theme-nocturne #mkd-misplaced-modal .b24-table-wrap_modal thead th,
body.is-theme-nocturne #mkd-receipt-amounts-modal .b24-table-wrap_modal thead th {
  background: var(--noct-bg);
  color: var(--noct-neutral-500);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--noct-text) 12%, transparent);
}

body.is-theme-nocturne #mkd-view-table tbody tr.b24-row-selected,
body.is-theme-nocturne #mkd-view-table tbody tr.b24-row-active:not(.b24-row-selected) {
  background: transparent;
}

body.is-theme-nocturne #mkd-view-table tbody tr.b24-row-active {
  box-shadow: inset 4px 0 0 var(--noct-accent);
  outline-color: color-mix(in srgb, var(--noct-accent) 45%, transparent);
}

/* ================================================================
   Nocturne polish: таблица МКД
   (правила лежат здесь, а не в styles.css: mkd.css подключён позже
   и при равной специфичности перебивал бы общие правила темы)
   ================================================================ */

/* Шапка отделяется от тела таблицы */
.b24-mkd-root.is-theme-nocturne .b24-table thead th,
.b24-mkd-root.is-theme-nocturne .b24-table thead th.b24-col-chk,
.b24-mkd-root.is-theme-nocturne .b24-table thead th.b24-col-sticky {
  background-color: var(--noct-header);
}

/* Наведение и выделение — разные состояния */
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr:hover td {
  background-color: var(--noct-hover);
}

.b24-mkd-root.is-theme-nocturne .b24-table tbody tr:has(> td:first-child input[type="checkbox"]:checked) td,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr.b24-row-selected td {
  background-color: var(--noct-selected);
}

/* Sticky-ячейкам нужен непрозрачный фон, иначе сквозь них
   просвечивают прокручиваемые столбцы */
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr:hover td.b24-col-chk:first-child,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr:hover td.b24-col-sticky {
  background-color: var(--noct-hover-solid);
}

.b24-mkd-root.is-theme-nocturne .b24-table tbody tr:has(> td:first-child input[type="checkbox"]:checked) td.b24-col-chk:first-child,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr:has(> td:first-child input[type="checkbox"]:checked) td.b24-col-sticky,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr.b24-row-selected td.b24-col-chk:first-child,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr.b24-row-selected td.b24-col-sticky {
  background-color: var(--noct-selected-solid);
}

.b24-mkd-root.is-theme-nocturne .b24-table tbody tr:has(> td:first-child input[type="checkbox"]:checked) td.b24-col-chk:first-child,
.b24-mkd-root.is-theme-nocturne .b24-table tbody tr.b24-row-selected td.b24-col-chk:first-child {
  box-shadow: inset 3px 0 0 0 var(--noct-accent);
}
