/* Инфопанель: карточки-цифры, итоги, вкладки и таблица окон. Только свои классы td-*. */
.td-dash-card { cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; }
.td-dash-card:hover { box-shadow: 0 0 0 2px rgb(81 175 47 / .45); }
.td-dash-card:focus-visible { outline: 2px solid var(--td-accent); outline-offset: 2px; }

.td-dash-heading { font-size: 1.05rem; font-weight: 600; margin-bottom: .5rem; }
.td-dash-muted { color: var(--gray-600); font-size: .9rem; }
.td-dash-link { background: none; border: 0; color: var(--td-link); cursor: pointer; padding: 0; font-size: .9rem; margin-bottom: .5rem; }
.td-dash-more { display: inline-block; margin-top: .75rem; color: var(--td-link); font-weight: 500; text-decoration: none; }
.td-dash-more:hover { text-decoration: underline; }

.td-board { border: 1px solid rgba(128, 128, 128, .25); border-radius: .75rem; padding: .85rem 1rem; }

.td-dash-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.td-dash-total { border: 1px solid rgba(128, 128, 128, .25); border-radius: .6rem; padding: .55rem .75rem; }
.td-dash-total-label { font-size: .75rem; color: var(--gray-600); }
.td-dash-total-value { font-size: 1.15rem; font-weight: 600; }
.td-dash-total-hint { font-size: .72rem; color: var(--gray-600); }

.td-dash-tabs-bar { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid rgba(128, 128, 128, .3); margin-bottom: .75rem; }
.td-dash-tab-btn { background: none; border: 0; border-bottom: 2px solid transparent; padding: .5rem .85rem; cursor: pointer; font-size: .9rem; color: var(--gray-600); min-height: 40px; }
.td-dash-tab-btn.is-active { color: var(--td-link); border-bottom-color: var(--td-accent); font-weight: 600; }

.td-dash-table-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .6rem; }
.td-dash-input { border: 1px solid rgba(128, 128, 128, .4); border-radius: .5rem; padding: .4rem .6rem; background: transparent; color: inherit; font-size: .9rem; min-height: 38px; }
.td-dash-table-tools .td-dash-input[type="search"] { flex: 1 1 14rem; min-width: 0; }
.td-dash-table-tools select.td-dash-input { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.td-dash-sort-select { display: none; }

.td-dash-grid { display: flex; flex-direction: column; border: 1px solid rgba(128, 128, 128, .25); border-radius: .6rem; overflow: hidden; }
/* Ширины колонок - из настроек таблицы (--td-template): при равных колонках имя контрагента ломалось на 5 строк, а числа сжимались. */
.td-dash-grid-head, .td-dash-row, .td-dash-grid-foot { display: grid; grid-template-columns: var(--td-template, repeat(var(--td-cols), minmax(0, 1fr))); gap: .5rem; padding: .45rem .75rem; align-items: center; }
.td-dash-grid-head { order: -1; background: rgba(128, 128, 128, .1); font-size: .78rem; font-weight: 600; }
.td-dash-th { background: none; border: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; padding: 0; }
.td-dash-th.is-end, .td-dash-cell.is-end { text-align: right; }
.td-dash-sort { color: var(--td-link); }
.td-dash-row { border-top: 1px solid rgba(128, 128, 128, .18); font-size: .88rem; }
.td-dash-row.is-link { cursor: pointer; }
.td-dash-row.is-link:hover { background: rgb(81 175 47 / .08); }
.td-dash-row.tone-danger { box-shadow: inset 3px 0 0 var(--danger-500); background: rgb(239 68 68 / .04); }
.td-dash-row.tone-warning { box-shadow: inset 3px 0 0 var(--warning-500); background: rgb(245 158 11 / .05); }
.td-dash-row.tone-success { box-shadow: inset 3px 0 0 var(--td-accent); }
.td-dash-cell { min-width: 0; overflow-wrap: break-word; }
.td-dash-cell.is-end { font-variant-numeric: tabular-nums; white-space: nowrap; }
.td-dash-cell a { color: var(--td-link); text-decoration: none; }
.td-dash-cell a:hover { text-decoration: underline; }
.td-dash-empty { padding: 1rem; text-align: center; color: var(--gray-600); order: 9999; }
.td-dash-grid-foot { margin-top: .4rem; border: 1px solid rgba(128, 128, 128, .25); border-radius: .6rem; background: rgba(128, 128, 128, .06); font-size: .88rem; }
.td-dash-count { margin-top: .35rem; font-size: .78rem; color: var(--gray-600); }

@media (max-width: 640px) {
    .td-dash-table-tools select.td-dash-input { flex: 1 1 100%; }
    .td-dash-sort-select { display: block; }
    .fi-wi-stats-overview-stat { padding: .75rem; }
    .fi-wi-stats-overview-stat-label { white-space: normal; overflow-wrap: anywhere; }
    .fi-wi-stats-overview-stat-value { font-size: 1.25rem; overflow-wrap: anywhere; }
    .fi-wi-stats-overview-stat-description { overflow-wrap: anywhere; font-size: .75rem; }
    .td-dash-grid-head { display: none; }
    .td-dash-row, .td-dash-grid-foot { grid-template-columns: 1fr; gap: .25rem; padding: .6rem .75rem; }
    .td-dash-cell, .td-dash-cell.is-end { text-align: left; display: flex; flex-direction: column; white-space: normal; }
    .td-dash-cell::before { content: attr(data-label); font-size: .7rem; color: var(--gray-600); }
    .td-dash-cell:empty { display: none; }
    .td-dash-cell.is-foot:empty { display: none; }
    .td-dash-tab-btn { padding: .5rem .6rem; }
    .td-dash-more { min-height: 40px; }
}

/* Компьютер: значение карточки-цифры в одну строку, шрифт подстраивается под ширину карточки. */
@media (min-width: 641px) {
    .td-dash-card { container-type: inline-size; }
    .td-dash-card .fi-wi-stats-overview-stat-value { white-space: nowrap; font-size: clamp(.9rem, 15cqw, 1.875rem); line-height: 1.2; }
}
