/* @ds-v23 (затвор: только токены) — Minta DS v3 · полоса C: отчёты и расчёты в островке `.ds22` (20.11.2026).
 * Раскладка и мелкие детали поверх компонентов DS (кнопки, поля, таблицы, карточки приходят из ui.js и components.css). */

/* ── Задолженности ── */
html .ds22 .ds-debts{padding:var(--space-6) var(--space-7) var(--space-10);display:flex;flex-direction:column;gap:var(--space-6)}
html .ds22 .ds-debts__bar{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-4)}
html .ds22 .ds-debts__cash{margin-left:auto;padding:0 var(--space-3);cursor:pointer;font:var(--type-body);color:var(--text-secondary);font-variant-numeric:tabular-nums;white-space:nowrap}
html .ds22 .ds-debts__table .ds-group td{background:var(--surface-sunken);height:var(--row-height);cursor:pointer;white-space:nowrap}
html .ds22 .ds-debts__table .ds-group td:first-child{white-space:normal}
html .ds22 .ds-debts__chev{display:inline-block;width:var(--space-5);margin-right:var(--space-4);text-align:center;color:var(--text-muted);font:var(--type-micro)}
html .ds22 .ds-debts__table td.ds-debts__chev{width:var(--space-9);margin:0}
html .ds22 .ds-debts__hint{margin-left:var(--space-4);color:var(--text-muted);font:var(--type-micro)}
html .ds22 .ds-debts__row{cursor:pointer}
html .ds22 .ds-debts__row[aria-selected="true"] td{background:var(--surface-sunken)}
html .ds22 .ds-debts__table td[data-money]{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
html .ds22 .ds-debts__sum--pos{color:var(--positive-strong)}
html .ds22 .ds-debts__sum--neg{color:var(--negative-strong)}
html .ds22 .ds-debts__table .ds-debts__detail td{height:auto;padding:0;background:var(--surface-sunken)}
html .ds22 .ds-debts__body{padding:var(--space-5) var(--space-6) var(--space-6)}
html .ds22 .ds-debts__bodyhead{display:flex;align-items:flex-start;gap:var(--space-5);margin-bottom:var(--space-4)}
html .ds22 .ds-debts__bodyhead .ds-debts__note{flex:1}
html .ds22 .ds-debts__note{color:var(--text-muted);font:var(--type-micro)}
html .ds22 .ds-debts__notes{max-width:calc(var(--space-12) * 12)}
html .ds22 .ds-debts__commit{display:grid;grid-template-columns:var(--space-12) var(--space-12) calc(var(--space-12) * 2) 1fr auto;gap:var(--space-4);align-items:center;padding:var(--space-2) 0;font:var(--type-body)}
html .ds22 .ds-debts__commit--pending{color:var(--text-muted)}
html .ds22 .ds-debts__num{font-variant-numeric:tabular-nums;white-space:nowrap}
html .ds22 .ds-debts__num--right{text-align:right}
html .ds22 .ds-debts__desc{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html .ds22 .ds-debts__actions{display:flex;gap:var(--space-2);white-space:nowrap}
html .ds22 .ds-debts__origin{font:var(--type-micro);white-space:nowrap}
html .ds22 .ds-debts__total{display:flex;gap:var(--space-6);margin-top:var(--space-4);padding-top:var(--space-4);border-top:var(--border-width) solid var(--border);font:var(--type-meta)}
html .ds22 .ds-debts__hero{font:var(--type-section-title);font-variant-numeric:tabular-nums;margin-bottom:var(--space-5)}
html .ds22 .ds-debts__foot{margin:var(--space-6) 0 0}
html .ds22 .ds-debts__type{margin-bottom:var(--space-5)}
html .ds22 .ds-debts__fields{display:flex;flex-direction:column;gap:var(--space-5)}
html .ds22 .ds-debts__vat{display:flex;flex-wrap:wrap;gap:var(--space-3)}
html .ds22 .ds-debts__vatfield{max-width:calc(var(--space-12) * 3);margin-top:var(--space-4)}
html .ds22 .ds-debts__cp{display:flex;align-items:center;gap:var(--space-4)}
html .ds22 .ds-debts__cplist{display:flex;flex-direction:column;gap:var(--space-2);margin-top:var(--space-2)}

/* ── Капитализация ── */
html .ds22 .ds-cap{padding:var(--space-6) var(--space-7) var(--space-10);display:flex;flex-direction:column;gap:var(--space-6)}
html .ds22 .ds-cap__title{margin:0}
html .ds22 .ds-cap__head{display:flex;justify-content:space-between;align-items:flex-start;gap:var(--space-6);flex-wrap:wrap}
html .ds22 .ds-cap__actions{display:flex;flex-wrap:wrap;gap:var(--space-4)}
html .ds22 .ds-cap__muted{margin:0;color:var(--text-muted);font:var(--type-body)}
html .ds22 .ds-cap__lead{max-width:calc(var(--space-12) * 10)}
html .ds22 .ds-cap__price,html .ds22 .ds-cap__metrics,html .ds22 .ds-cap__step,html .ds22 .ds-cap__params,html .ds22 .ds-cap__intro{padding:var(--space-6) var(--space-7);display:flex;flex-direction:column;gap:var(--space-3)}
html .ds22 .ds-cap__params,html .ds22 .ds-cap__intro{max-width:calc(var(--space-12) * 11);gap:var(--space-5)}
html .ds22 .ds-cap__delta--up{color:var(--positive-strong)}
html .ds22 .ds-cap__delta--down{color:var(--negative-strong)}
html .ds22 .ds-cap__metrics{flex-direction:row;flex-wrap:wrap;gap:var(--space-6) var(--space-9)}
html .ds22 .ds-cap__metric{min-width:calc(var(--space-12) * 3)}
html .ds22 .ds-cap__metricvalue{font:var(--type-subsection);font-variant-numeric:tabular-nums;margin-top:var(--space-1)}
html .ds22 .ds-cap__steptitle{margin:0;font:var(--type-subsection)}
html .ds22 .ds-cap__stepbody{display:flex;flex-wrap:wrap;gap:var(--space-6);align-items:flex-start}
html .ds22 .ds-cap__explain{flex:1 1 calc(var(--space-12) * 5);color:var(--text-secondary);font:var(--type-body);display:flex;flex-direction:column;gap:var(--space-4)}
html .ds22 .ds-cap__result{text-align:right;min-width:calc(var(--space-12) * 3)}
html .ds22 .ds-cap__history summary{cursor:pointer;color:var(--text-secondary);font:var(--type-body);margin-bottom:var(--space-4)}
html .ds22 .ds-cap__note{color:var(--text-muted);font:var(--type-micro)}

/* ── Сверка остатков ── */
html .ds22 .ds-recon__title{margin:0 0 var(--space-7);font:var(--type-page-title)}
html .ds22 .ds-recon__reason{display:flex;gap:var(--space-6);margin-bottom:var(--space-6);max-width:calc(var(--space-12) * 13)}
html .ds22 .ds-recon__mark{flex:0 0 var(--control-height);height:var(--control-height);display:flex;align-items:center;justify-content:center;border:var(--border-width) solid var(--border);border-radius:var(--radius-md);color:var(--text-muted)}
html .ds22 .ds-recon__reasontext{font:var(--type-body);color:var(--text-secondary)}
html .ds22 .ds-recon__reasontext b{color:var(--text-primary)}
html .ds22 .ds-recon__panel{margin-top:var(--space-9);max-width:calc(var(--space-12) * 14);padding:var(--space-7) var(--space-8);display:flex;flex-direction:column;gap:var(--space-6)}
html .ds22 .ds-recon__lead{font:var(--type-body);color:var(--text-secondary);max-width:calc(var(--space-12) * 13)}
html .ds22 .ds-recon__select{max-width:calc(var(--space-12) * 6)}
html .ds22 .ds-recon__upload{display:flex;flex-direction:column;gap:var(--space-5)}
html .ds22 .ds-recon__actions{display:flex;flex-wrap:wrap;gap:var(--space-4);align-items:center}
html .ds22 .ds-recon__label,html .ds22 .ds-recon__muted{color:var(--text-muted)}
html .ds22 .ds-recon__result{display:flex;flex-direction:column;gap:var(--space-4);padding-top:var(--space-7);border-top:var(--border-width) solid var(--border);font:var(--type-body)}
html .ds22 .ds-recon__verdict{font:var(--type-subsection)}
html .ds22 .ds-recon__counters{display:flex;flex-direction:column;gap:var(--space-2)}
html .ds22 .ds-recon__balance{padding:var(--space-5) var(--space-6);max-width:calc(var(--space-12) * 13);border-left:3px solid var(--positive)}
html .ds22 .ds-recon__balance--bad{border-left-color:var(--negative)}
html .ds22 .ds-recon__subtitle{margin:0 0 var(--space-3);font:var(--type-meta)}
html .ds22 .ds-recon__kv{display:grid;grid-template-columns:calc(var(--space-12) * 3) 1fr;gap:var(--space-2) var(--space-5)}
html .ds22 .ds-recon__num{font-variant-numeric:tabular-nums;white-space:nowrap}
html .ds22 .ds-recon__num--pos{color:var(--positive-strong)}
html .ds22 .ds-recon__num--neg{color:var(--negative-strong)}
html .ds22 .ds-recon__hint{margin-top:var(--space-4);color:var(--text-muted);font:var(--type-micro)}
html .ds22 .ds-recon__nowrap{white-space:nowrap}
html .ds22 .ds-recon__purpose{max-width:calc(var(--space-12) * 6)}

/* ── Счета на оплату ── */
html .ds22 .ds-inv{padding:var(--space-6) var(--space-7) var(--space-10);display:flex;flex-direction:column;gap:var(--space-5)}
html .ds22 .ds-inv__title{margin:0;font:var(--type-section-title)}
html .ds22 .ds-inv__subtitle{margin:var(--space-3) 0 0;font:var(--type-subsection)}
html .ds22 .ds-inv__bar{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-4)}
html .ds22 .ds-inv__q{max-width:calc(var(--space-12) * 4)}
html .ds22 .ds-inv__lead{margin:0;max-width:calc(var(--space-12) * 12);font:var(--type-body);color:var(--text-secondary)}
html .ds22 .ds-inv__lead b{color:var(--text-primary)}
html .ds22 .ds-inv__muted{margin:0;color:var(--text-muted);font:var(--type-body)}
html .ds22 .ds-inv__sub{color:var(--text-muted);font:var(--type-micro)}
html .ds22 .ds-inv__plate{max-width:calc(var(--space-12) * 17)}
html .ds22 .ds-inv__actions{display:flex;flex-wrap:wrap;gap:var(--space-3);justify-content:flex-end;align-items:center;white-space:nowrap}
html .ds22 .ds-inv__actions .ds-select{width:auto}
html .ds22 .ds-inv__row{cursor:pointer}
html .ds22 .ds-inv__th{width:var(--w)}
html .ds22 .ds-inv__steps{margin-bottom:var(--space-3)}
html .ds22 .ds-inv__grid2{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-5) var(--space-6)}
html .ds22 .ds-inv__grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-6);margin-bottom:var(--space-5)}
html .ds22 .ds-inv__narrow{max-width:calc(var(--space-12) * 12);width:100%}
html .ds22 .ds-inv__numrow{display:flex;gap:var(--space-6);align-items:flex-end;max-width:calc(var(--space-12) * 12)}
html .ds22 .ds-inv__numrow .ds-field:first-child{flex:1}
html .ds22 .ds-inv__items{max-width:calc(var(--space-12) * 14)}
html .ds22 .ds-inv__qty{width:calc(var(--space-12) * 2)}
html .ds22 .ds-inv__price{width:calc(var(--space-12) * 2 + var(--space-9))}
html .ds22 .ds-inv__vat{width:calc(var(--space-12) + var(--space-6));margin-top:var(--space-2)}
html .ds22 .ds-inv__total{max-width:calc(var(--space-12) * 14);text-align:right;font:var(--type-body);font-variant-numeric:tabular-nums}
html .ds22 .ds-inv__modal{width:min(640px,calc(100vw - var(--space-9)))}
html .ds22 .ds-inv__img{display:flex;flex-direction:column;gap:var(--space-3)}
html .ds22 .ds-inv__imgprev{display:block;max-width:100%;max-height:calc(var(--space-12) * 2)}

/* ── Статьи начислений (редактор П&У в островке) ── */
html .ds22 .ds-rep__modal{width:min(640px,calc(100vw - var(--space-9)))}
html .ds22 .ds-rep__modal--narrow{width:min(520px,calc(100vw - var(--space-9)));z-index:calc(var(--z-modal) + 1)}
html .ds22 .ds-rep__muted{color:var(--text-muted);font:var(--type-body)}
html .ds22 .ds-rep__tree{display:flex;flex-direction:column;gap:var(--space-1)}
html .ds22 .ds-rep__row{display:flex;align-items:center;gap:var(--space-4);padding:var(--space-1) 0}
html .ds22 .ds-rep__row--entry{padding-left:var(--space-8)}
html .ds22 .ds-rep__row--group{padding-left:var(--space-5)}
html .ds22 .ds-rep__row--section{font-weight:700;padding-top:var(--space-4)}
html .ds22 .ds-rep__row .ds-rep__name{flex:1;justify-content:flex-start;text-align:left}
html .ds22 .ds-rep__name--group{font-weight:600}
html .ds22 .ds-rep__sectionname{flex:1}
html .ds22 .ds-rep__input{flex:1}
html .ds22 .ds-rep__month{min-width:calc(var(--space-12) + var(--space-6))}
html .ds22 .ds-rep__cats{display:flex;flex-direction:column;gap:var(--space-2);margin-top:var(--space-4);padding-top:var(--space-4);border-top:var(--border-width) solid var(--border)}
html .ds22 .ds-rep__cat span:nth-child(2){flex:1}
