/* Таблицы и блоки tt-* (раньше TapsyruTableStyles.StyleTag() вставлял их в каждую страницу) */
.tt-card {
    background: var(--tds-surface);
    border: 1px solid var(--tds-hair);
    border-radius: 16px;
    overflow: hidden;
    font-family: var(--tds-font);
}
.tt-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--tds-hair);
}
/* Внутри белой карточки формы (визард) своя рамка и белый фон дают «карточку в карточке»,
   которая на глаз просто сливается — там таблица идёт плоской, структуру держат шапка и зебра. */
.card-body .tt-card { border: none; border-radius: 0; background: transparent; }
.card-body .tt-card > .tt-toolbar { padding-left: 0; padding-right: 0; }
.card-body .tt-card > .tt-pager { padding-left: 0; padding-right: 0; }
.card-body .tt-card > .tt-alert { margin-left: 0; margin-right: 0; }
.card-body .tt-card .tt-table thead th:first-child,
.card-body .tt-card .tt-table tbody td:first-child,
.card-body .tt-card .tt-table tfoot td:first-child { padding-left: 12px; }
.card-body .tt-card .tt-table thead th:last-child,
.card-body .tt-card .tt-table tbody td:last-child,
.card-body .tt-card .tt-table tfoot td:last-child { padding-right: 12px; }
.card-body .tt-card > .tt-empty { padding-left: 0; padding-right: 0; }

.tt-toolbar-left { display: flex; align-items: center; gap: 10px; }
.tt-title { font: 600 13px/1.2 var(--tds-font); color: var(--tds-ink); }
.tt-count {
    display: inline-flex; align-items: center; height: 22px; padding: 0 10px;
    border-radius: 11px; background: var(--tds-muted-bg); color: var(--tds-primary);
    font: 600 11.5px/1 var(--tds-font); white-space: nowrap;
}
.tt-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.tt-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 32px; padding: 0 14px; border-radius: 9px; border: 1px solid transparent;
    font: 600 12.5px/1 var(--tds-font); white-space: nowrap; cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.tt-btn i { font-size: 15px; line-height: 1; }
.tt-btn-primary { background: var(--tds-primary); color: var(--tds-surface); }
.tt-btn-primary:hover { background: var(--tds-primary-hover); color: var(--tds-surface); }
.tt-btn-success { background: var(--tds-success); color: var(--tds-surface); }
.tt-btn-success:hover { background: var(--tds-success); color: var(--tds-surface); }
.tt-btn-ghost { background: var(--tds-surface); border-color: var(--tds-border); color: var(--tds-ink-2); }
.tt-btn-ghost:hover { background: var(--tds-hover); border-color: var(--tds-primary-100); color: var(--tds-primary); }
.tt-btn-danger { background: var(--tds-surface); border-color: var(--tds-danger-border); color: var(--tds-danger); }
.tt-btn-danger:hover { background: var(--tds-danger-bg); border-color: var(--tds-danger-border); color: var(--tds-danger); }

.tt-scroll { overflow-x: auto; }
table.tt-table { width: 100%; border-collapse: collapse; font-family: var(--tds-font); }
.tt-table thead th {
    background: var(--tds-zebra); text-align: left; white-space: nowrap;
    padding: 12px 16px; border-bottom: 1px solid var(--tds-hair);
    font: 600 11px/1.2 var(--tds-font); letter-spacing: .06em; text-transform: uppercase; color: var(--tds-ink-3);
}
.tt-table tbody td {
    padding: 14px 16px; border-bottom: 1px solid var(--tds-hair); vertical-align: top;
    font: 500 13px/1.45 var(--tds-font); color: var(--tds-ink);
}
/* зебра заметная, но не грязная: на дешёвых TN-матрицах разница в 1-2% просто не видна */
.tt-table tbody tr:nth-child(even) td { background: var(--tds-zebra); }
.tt-table tbody tr:hover td { background: var(--tds-hover); }
.tt-table tbody tr:last-child td { border-bottom: none; }

/* через td: правило .tt-table tbody td задаёт шрифт шорткатом и иначе перебивает эти классы */
.tt-table tbody td.tt-num { width: 56px; color: var(--tds-ink-4); font-weight: 600; font-variant-numeric: tabular-nums; }
.tt-table tbody td.tt-mono { font-family: var(--tds-mono); font-size: 12.5px; color: var(--tds-ink-2); }
.tt-table tbody td.tt-money { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.tt-table tbody td.tt-money-muted { color: var(--tds-ink-3); font-weight: 500; }
.tt-name { font-weight: 600; color: var(--tds-ink); }
/* адрес и прочие пояснения — второй строкой, не отдельной колонкой: длинный адрес иначе душит таблицу */
.tt-sub { display: block; margin-top: 5px; font: 500 12px/1.4 var(--tds-font); color: var(--tds-ink-3); }
.tt-sub i { font-size: 13px; margin-right: 4px; opacity: .85; }
.tt-sub-warn { color: var(--tds-danger); }
.tt-chip {
    display: inline-block; padding: 3px 10px; border-radius: 8px;
    background: var(--tds-muted-bg); color: var(--tds-primary); font: 600 11.5px/1.45 var(--tds-font);
}
.tt-mono { font-family: var(--tds-mono); font-size: 12.5px; color: var(--tds-ink-2); }
.tt-money { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.tt-money-muted { color: var(--tds-ink-3); font-weight: 500; }

.tt-table tfoot td, .tt-foot td {
    background: var(--tds-muted-bg); border-top: 2px solid var(--tds-hair); border-bottom: none;
    padding: 14px 16px; font: 700 13.5px/1.3 var(--tds-font); color: var(--tds-ink);
}
.tt-foot-label { text-align: right; letter-spacing: .04em; text-transform: uppercase; font-size: 11.5px; color: var(--tds-ink-3); }

.tt-rowactions { text-align: right; white-space: nowrap; width: 1%; }
.tt-iconbtn {
    width: 32px; height: 32px; margin-left: 6px; border-radius: 9px;
    border: 1px solid var(--tds-hair); background: var(--tds-surface); color: var(--tds-ink-3);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.tt-iconbtn i { font-size: 16px; line-height: 1; }
.tt-iconbtn:hover { background: var(--tds-hover); border-color: var(--tds-primary-100); color: var(--tds-primary); }
.tt-iconbtn-danger:hover { background: var(--tds-danger-bg); border-color: var(--tds-danger-border); color: var(--tds-danger); }

.tt-pager {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 20px; border-top: 1px solid var(--tds-hair);
}
.tt-pager-info { font: 500 12px/1 var(--tds-font); color: var(--tds-ink-3); }
.tt-pages { display: flex; gap: 4px; }
.tt-page {
    min-width: 32px; height: 32px; padding: 0 8px; border-radius: 9px;
    border: 1px solid var(--tds-hair); background: var(--tds-surface); color: var(--tds-ink-2);
    font: 600 12.5px/1 var(--tds-font); cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.tt-page:hover:not(:disabled) { background: var(--tds-hover); border-color: var(--tds-primary-100); }
.tt-page[aria-current='true'] { background: var(--tds-success); border-color: var(--tds-success); color: var(--tds-surface); }
.tt-page:disabled { color: var(--tds-ink-4); cursor: default; }

.tt-alert {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 16px 20px 0; padding: 12px 14px; border-radius: 12px;
    background: var(--tds-warn-bg); border: 1px solid var(--tds-warn-border); color: var(--tds-warn);
    font: 500 12.5px/1.45 var(--tds-font);
}
.tt-alert i { font-size: 16px; line-height: 1.2; }
/* тот же алерт, но вне карточки — своей рамки хватает, внешние отступы другие */
.tt-alert-standalone { margin: 0 0 12px; }

.tt-empty { padding: 44px 24px; text-align: center; }
.tt-empty-icon {
    width: 64px; height: 64px; border-radius: 20px; background: var(--tds-muted-bg); color: var(--tds-primary);
    display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.tt-empty-icon i { font-size: 30px; }
.tt-empty-title { font: 600 15px/1.3 var(--tds-font); color: var(--tds-ink); margin: 0 0 6px; }
.tt-empty-text { font: 500 13px/1.5 var(--tds-font); color: var(--tds-ink-3); margin: 0; }

.tt-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 24px; text-align: left; }
.tt-choice-card {
    border: 1px solid var(--tds-hair); border-radius: 14px; padding: 16px; background: var(--tds-surface);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tt-choice-card:hover { border-color: var(--tds-primary-100); box-shadow: none; transform: translateY(-1px); }
.tt-choice-card .tt-btn { width: 100%; margin-bottom: 10px; }
.tt-choice-text { font: 500 12px/1.45 var(--tds-font); color: var(--tds-ink-3); }

/* редактор объектов ВС/СГО и ТМЦ (React-аккордеон) — те же токены, что и у таблиц */
.tt-oe { display: flex; flex-direction: column; gap: 12px; font-family: var(--tds-font); }
/* карточки редактора чаще всего лежат на белом фоне формы, поэтому рамка контрастнее,
   а свёрнутая карточка ещё и слегка подкрашена — иначе на TN-матрице их границ не видно */
.tt-oe-item {
    border: 1px solid var(--tds-border); border-radius: 14px; background: var(--tds-zebra); overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.tt-oe-item.is-open { border-color: var(--tds-primary-100); background: var(--tds-surface); box-shadow: none; }
.tt-oe-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.tt-oe-head:hover { background: var(--tds-zebra); }
.tt-oe-badge {
    flex: 0 0 auto; width: 26px; height: 26px; border-radius: 9px;
    background: var(--tds-muted-bg); color: var(--tds-primary); display: inline-flex; align-items: center; justify-content: center;
    font: 700 12px/1 var(--tds-font);
}
.tt-oe-titles { flex: 1 1 auto; min-width: 0; }
.tt-oe-title { font: 600 13.5px/1.3 var(--tds-font); color: var(--tds-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-oe-meta { margin-top: 3px; font: 500 12px/1.35 var(--tds-font); color: var(--tds-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-oe-chevron { color: var(--tds-ink-4); font-size: 18px; line-height: 1; }
.tt-oe-body { padding: 2px 16px 18px; border-top: 1px solid var(--tds-hair); }
.tt-oe-field { margin-top: 14px; }
.tt-oe-label {
    display: block; margin-bottom: 6px;
    font: 600 11px/1.2 var(--tds-font); letter-spacing: .06em; text-transform: uppercase; color: var(--tds-ink-3);
}
.tt-oe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.tt-oe-section { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--tds-zebra); border: 1px solid var(--tds-hair); }
.tt-oe-section > .tt-oe-field:first-child { margin-top: 0; }
.tt-oe-input, .tt-oe-select {
    width: 100%; min-height: 38px; padding: 8px 12px; border-radius: 10px;
    border: 1px solid var(--tds-border); background: var(--tds-surface); color: var(--tds-ink);
    font: 500 13px/1.4 var(--tds-font);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.tt-oe-input:focus, .tt-oe-select:focus { outline: none; border-color: var(--tds-primary); box-shadow: var(--tds-ring); }
.tt-oe-input:disabled, .tt-oe-select:disabled { background: var(--tds-muted-bg); color: var(--tds-ink-4); }
.tt-oe-invalid { border-color: var(--tds-danger-border); background: var(--tds-danger-bg); }
.tt-oe-error { margin-top: 5px; font: 500 11.5px/1.3 var(--tds-font); color: var(--tds-danger); }
.tt-oe-linkbtn {
    margin-top: 10px; padding: 0; background: none; border: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 5px;
    font: 600 12px/1.2 var(--tds-font); color: var(--tds-primary);
}
.tt-oe-linkbtn:hover { color: var(--tds-success); }

.tt-oe-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tt-oe-toolbar-left { display: flex; align-items: center; gap: 10px; }
/* подпись под полем, которое пользователь не заполняет сам (зафиксированный тип объекта) */
.tt-oe-hint { margin-top: 6px; font: 500 11.5px/1.35 var(--tds-font); color: var(--tds-ink-4); }
.tt-oe-num { text-align: right; font-variant-numeric: tabular-nums; }
.tt-oe .tt-empty { border: 1px dashed var(--tds-border); border-radius: 14px; background: var(--tds-zebra); padding: 32px 24px; }
.tt-empty-action { margin-top: 16px; }

/* --- загрузка объектов из отчёта: подсказки, прогресс, итоги, статусы --- */

/* спокойная информационная плашка; тревожный янтарный .tt-alert для неё слишком громкий */
.tt-note {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 0 0 16px; padding: 12px 14px; border-radius: 12px;
    background: var(--tds-muted-bg); border: 1px solid var(--tds-primary-100); color: var(--tds-ink-2);
    font: 500 12.5px/1.45 var(--tds-font);
}
.tt-note i { font-size: 16px; line-height: 1.2; color: var(--tds-primary); }
.tt-hint { margin-top: 8px; font: 500 12px/1.45 var(--tds-font); color: var(--tds-ink-3); }
.tt-alert-danger { background: var(--tds-danger-bg); border-color: var(--tds-danger-border); color: var(--tds-danger); }
.tt-alert-danger i { color: var(--tds-danger); }

/* шапка результата: иконка в плашке + заголовок + пояснение. Без центровки и иконок на 4rem —
   это промежуточный экран визарда, а не страница успеха */
.tt-result { display: flex; align-items: center; gap: 14px; }
.tt-result-icon {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--tds-muted-bg); color: var(--tds-primary);
}
.tt-result-icon i { font-size: 24px; line-height: 1; }
.tt-result-icon-success { background: var(--tds-success-bg); color: var(--tds-success); }
.tt-result-icon-danger { background: var(--tds-danger-bg); color: var(--tds-danger); }
.tt-result-body { min-width: 0; }
.tt-result-title { font: 600 15px/1.3 var(--tds-font); color: var(--tds-ink); }
.tt-result-text { margin-top: 3px; font: 500 12.5px/1.45 var(--tds-font); color: var(--tds-ink-3); }

.tt-spinner {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid var(--tds-primary-100); border-top-color: var(--tds-primary);
    animation: tt-spin .8s linear infinite;
}
@keyframes tt-spin { to { transform: rotate(360deg); } }

.tt-progress { margin-top: 16px; }
.tt-progress-track { height: 8px; border-radius: var(--tds-r-sm); background: var(--tds-hair); overflow: hidden; }
.tt-progress-bar { height: 100%; border-radius: var(--tds-r-sm); background: var(--tds-primary); transition: width .5s ease-out; }
.tt-progress-meta {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px;
    font: 500 12px/1.3 var(--tds-font); color: var(--tds-ink-3);
}
.tt-progress-value { font: 700 12.5px/1.3 var(--tds-font); color: var(--tds-primary); font-variant-numeric: tabular-nums; }

.tt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 12px; margin-top: 20px; }
.tt-stat { padding: 14px 16px; border: 1px solid var(--tds-hair); border-radius: 14px; background: var(--tds-surface); }
.tt-stat-value { font: 700 22px/1.1 var(--tds-font); color: var(--tds-ink); font-variant-numeric: tabular-nums; }
.tt-stat-label {
    margin-top: 5px; font: 600 11px/1.2 var(--tds-font);
    letter-spacing: .06em; text-transform: uppercase; color: var(--tds-ink-3);
}
.tt-stat-accent .tt-stat-value { color: var(--tds-primary); }
.tt-stat-success .tt-stat-value { color: var(--tds-success); }
.tt-stat-warn .tt-stat-value { color: var(--tds-warn); }
.tt-stat-danger .tt-stat-value { color: var(--tds-danger); }

.tt-status {
    display: inline-block; padding: 3px 10px; border-radius: 8px; white-space: nowrap;
    background: var(--tds-muted-bg); color: var(--tds-primary); font: 600 11.5px/1.45 var(--tds-font);
}
.tt-status-added { background: var(--tds-success-bg); color: var(--tds-success); }
.tt-status-updated { background: var(--tds-warn-bg); color: var(--tds-warn); }
.tt-status-existing { background: var(--tds-muted-bg); color: var(--tds-primary); }
.tt-status-restored { background: var(--tds-info-bg); color: var(--tds-info); }
.tt-status-skipped { background: var(--tds-danger-bg); color: var(--tds-danger); }

/* строка-аккордеон по типу имущества и раскрывающийся список под ней.
   Детализация — дивами, а не вложенной таблицей: правила .tt-table tbody td бьют по вложенным td
   своей специфичностью и превращают подсписок в кашу из отступов и зебры */
.tt-table tbody tr.tt-row-toggle td { cursor: pointer; }
.tt-toggle-icon { color: var(--tds-ink-4); font-size: 16px; margin-right: 6px; vertical-align: -3px; }
.tt-table tbody td.tt-nested { padding: 0; background: var(--tds-zebra); }
.tt-table tbody tr:hover td.tt-nested { background: var(--tds-zebra); }
.tt-detail-row {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 10px 16px 10px 42px; border-top: 1px solid var(--tds-hair);
}
.tt-detail-inv {
    flex: 0 0 150px; font-family: var(--tds-mono);
    font-size: 12.5px; line-height: 1.45; color: var(--tds-ink-2);
}
.tt-detail-desc { flex: 1 1 auto; min-width: 0; font: 500 12.5px/1.45 var(--tds-font); color: var(--tds-ink); }
.tt-detail-status { flex: 0 0 auto; }
.tt-detail-link { flex: 0 0 24px; text-align: right; color: var(--tds-ink-4); }
.tt-detail-link a { color: var(--tds-ink-4); text-decoration: none; }
.tt-detail-link a:hover { color: var(--tds-primary); }
.tt-muted { color: var(--tds-ink-4); }

/* единственный способ набрать объекты: сетка из одной карточки растягивается на всю ширину и выглядит нелепо */
.tt-choice-narrow { max-width: 460px; margin-left: auto; margin-right: auto; }

@media (max-width: 768px) {
    .tt-table thead th, .tt-table tbody td, .tt-table tfoot td { padding: 12px; }
    .tt-toolbar, .tt-pager { padding: 12px 14px; }
    .tt-detail-row { flex-wrap: wrap; padding-left: 16px; }
    .tt-detail-inv { flex-basis: 100%; }
}

/* бейджи в ячейках реестров (статус, тип имущества, признаки) — та же шкала, что ar-badge payda */
.tt-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tt-badge {
    display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
    border-radius: var(--tds-r-xs); white-space: nowrap;
    font: 700 11px/1 var(--tds-font); background: var(--tds-muted-bg); color: var(--tds-ink-3);
}
.tt-badge--ok { background: var(--tds-success-bg); color: var(--tds-success); }
.tt-badge--bad { background: var(--tds-danger-bg); color: var(--tds-danger); }
.tt-badge--warn { background: var(--tds-warn-bg); color: var(--tds-warn); }
.tt-badge--info { background: var(--tds-primary-50); color: var(--tds-primary); }
.tt-badge--muted { background: var(--tds-muted-bg); color: var(--tds-ink-3); }

/* реестр передач (MnuCartList): ширины — без них описание растягивает таблицу и остальные колонки схлопываются в столбик букв */
.cart-tt-subject { min-width: 260px; max-width: 380px; }
.cart-tt-party { min-width: 190px; max-width: 260px; }
.cart-tt-organs { min-width: 180px; max-width: 240px; }
.cart-tt-dates { white-space: nowrap; }
.cart-tt-num { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.cart-tt-num a, .cart-tt-num span.tt-mono { font: 600 12.5px/1.4 var(--tds-mono); color: var(--tds-primary); text-decoration: none; }
.cart-tt-num a:hover { text-decoration: underline; }
.cart-tt-num .tt-sub { display: inline; margin: 0; }
.tt-table tbody td.cart-tt-subject a.cart-tt-desc { color: var(--tds-ink); text-decoration: none; }
.tt-table tbody td.cart-tt-subject a.cart-tt-desc:hover { color: var(--tds-primary); text-decoration: underline; }
/* бейдж с длинным текстом (КФС) внутри ячейки — переносится, а не вылезает за колонку */
.tt-sub .tt-badge, .tt-table td .tt-badge.is-wrap { height: auto; padding: 3px 8px; line-height: 1.3; white-space: normal; }
.tt-sub .tt-badge { display: inline-block; margin-top: 4px; }
