/* @ds-v23 (затвор: только токены) — Minta DS v3 · полоса J: отчёты (П&У, ДДС) и рабочий стол.
 * Разметка экранов собрана на компонентах DS (ds-btn, ds-select, ds-input, ds-segmented, ds-modal, ds-alert, ds-badge, ds-card);
 * здесь только то, чего в DS нет: клетки таблицы отчёта, подкраска по величине, полосы и столбцы рабочего стола.
 * Значения из данных приходят присвоением --переменных в style="--x:…"; свойство берётся здесь.
 */

/* ───────── отчёты (П&У, ДДС) ───────── */
html .ds22 #reports-screen .ds-select,
html .ds22 #reports-screen .ds-input[type="date"]{width:auto;min-width:0}
html .ds22 #reports-screen .rep-multi{height:auto;min-width:190px;padding:var(--space-2) var(--space-3)}
html .ds22 #reports-screen .rep-search{min-width:190px}
html .ds22 #reports-screen .rep-toolbar{display:flex;justify-content:flex-end;gap:var(--space-3);padding:var(--space-1) 0}
html .ds22 #reports-screen .rep-scroll{overflow-x:auto}
html .ds22 #reports-screen .rep-note{padding:var(--space-7);color:var(--text-secondary);font:var(--type-body)}
html .ds22 #reports-screen .rep-pad{padding:var(--space-3) var(--space-4)}
html .ds22 #reports-screen .rep-micro{font:var(--type-micro)}
html .ds22 #reports-screen .rep-forecast{background:var(--information-subtle)}
html .ds22 #reports-screen .rep-plan{color:var(--text-muted)}
html .ds22 #reports-screen .rep-indent{padding-left:var(--pl)}
html .ds22 #reports-screen .rep-planned{display:inline-flex;align-items:center;gap:var(--space-2);min-height:var(--target-min)}
/* клетка-кнопка провала: цель щелчка не меньше --target-min, ширина колонки не меняется */
html .ds22 #reports-screen .rep-cell{display:inline-flex;flex-direction:column;align-items:flex-end;justify-content:center;width:100%;min-height:var(--target-min);padding:0;border:0;background-color:transparent;color:inherit;font:inherit;cursor:pointer}
/* подкраска ячеек по величине: непрозрачность 0–0,28 приходит из данных переменной --heat */
html .ds22 #reports-screen .rep-heat{position:relative;isolation:isolate}
html .ds22 #reports-screen .rep-heat::before{content:"";position:absolute;inset:0;z-index:-1;background:var(--information);opacity:var(--heat);pointer-events:none}
html .ds22 #reports-screen .rep-cat-error{margin-bottom:var(--space-4);align-items:center;justify-content:space-between;flex-wrap:wrap}
html .ds22 #reports-screen .rep-cat-error__buttons{display:flex;gap:var(--space-3);flex-wrap:wrap}
html .ds22 #reports-screen .rep-setting{align-items:flex-start;padding:var(--space-3) 0}
html .ds22 #reports-screen .rep-setting + .rep-setting{margin-top:var(--space-3)}

/* ───────── рабочий стол ───────── */
html .ds22 #desk-screen.dk-screen{flex:1;min-height:0;overflow:auto;padding:var(--space-7) var(--space-8) var(--space-9)}
html .ds22 #desk-screen.dk-pad{padding:var(--space-8)}
html .ds22 #desk-screen .dk-gap{margin-bottom:var(--space-6)}
html .ds22 #desk-screen .dk-gap-lg{margin-bottom:var(--space-7)}
html .ds22 #desk-screen .dk-empty{margin:var(--space-9) 0;color:var(--text-muted)}
html .ds22 #desk-screen .dk-rule{border:0;border-top:1px solid var(--border);margin:0 0 var(--space-7)}
html .ds22 #desk-screen .dk-p{margin:0}
html .ds22 #desk-screen .dk-cap{font:var(--type-micro);letter-spacing:var(--type-micro-tracking);text-transform:uppercase;color:var(--text-muted)}
html .ds22 #desk-screen .dk-micro{font:var(--type-micro);color:var(--text-muted)}
html .ds22 #desk-screen .dk-hint{margin:0 0 var(--space-5);font:var(--type-micro);color:var(--text-muted)}
html .ds22 #desk-screen .dk-muted{color:var(--text-muted)}
html .ds22 #desk-screen .dk-sec{color:var(--text-secondary)}
html .ds22 #desk-screen .dk-grow{flex:1;min-width:0}
html .ds22 #desk-screen .dk-display{font:var(--type-display);font-variant-numeric:tabular-nums}
html .ds22 #desk-screen .dk-tone--pos{color:var(--positive-strong)}
html .ds22 #desk-screen .dk-tone--neg{color:var(--negative-strong)}
html .ds22 #desk-screen .dk-tone--neutral{color:var(--text-primary)}
html .ds22 #desk-screen .dk-kpis{display:flex;flex-wrap:wrap;gap:var(--space-6);margin-bottom:var(--space-6)}
html .ds22 #desk-screen .dk-kpi{flex:1;min-width:210px;padding:var(--space-6) var(--space-7);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md)}
html .ds22 #desk-screen .dk-kpi__head{display:flex;align-items:center;gap:var(--space-4);margin-bottom:var(--space-2)}
html .ds22 #desk-screen .dk-kpi__value{font:var(--type-money-large);font-variant-numeric:tabular-nums;white-space:nowrap}
html .ds22 #desk-screen .dk-block{min-width:0;padding:var(--space-6) var(--space-7);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md)}
html .ds22 #desk-screen .dk-block__title{margin:0 0 var(--space-1);font:var(--type-micro);letter-spacing:var(--type-micro-tracking);text-transform:uppercase;color:var(--text-muted)}
html .ds22 #desk-screen .dk-block__sub{margin:0 0 var(--space-5);font:var(--type-micro);color:var(--text-muted)}
html .ds22 #desk-screen .dk-block__gap{height:var(--space-4)}
html .ds22 #desk-screen .dk-why{margin:0;color:var(--text-muted)}
html .ds22 #desk-screen .dk-why--warn{color:var(--warning-strong)}
html .ds22 #desk-screen .dk-note{margin:var(--space-3) 0 0;color:var(--text-secondary)}
html .ds22 #desk-screen .dk-note--neg{color:var(--negative-strong)}
html .ds22 #desk-screen .dk-foot{margin:var(--space-7) 0 0;padding:var(--space-5) var(--space-6);background:var(--surface-muted);border-left:2px solid var(--border-strong);border-radius:0 var(--radius-md) var(--radius-md) 0;color:var(--text-muted)}
/* строки списков карточек */
html .ds22 #desk-screen .dk-lines{margin-top:var(--space-6)}
html .ds22 #desk-screen .dk-line{display:flex;justify-content:space-between;gap:var(--space-4);padding:var(--space-3) 0;border-bottom:1px solid var(--border)}
html .ds22 #desk-screen .dk-line--wide{gap:var(--space-5)}
html .ds22 #desk-screen .dk-hero{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--space-4)}
html .ds22 #desk-screen .dk-tile{padding:var(--space-6);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg)}
html .ds22 #desk-screen .dk-tile__value{margin-top:var(--space-2)}
html .ds22 #desk-screen .dk-tile__sum{margin-top:var(--space-1);color:var(--text-muted)}
/* график-полосы: ширина заливки приходит переменной --w */
html .ds22 #desk-screen .dk-bars{display:flex;flex-direction:column;gap:var(--space-5)}
html .ds22 #desk-screen .dk-bar__head{display:flex;align-items:baseline;gap:var(--space-4);margin-bottom:var(--space-2)}
html .ds22 #desk-screen .dk-bar__name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html .ds22 #desk-screen .dk-bar__val{flex:none;font-variant-numeric:tabular-nums;color:var(--text-secondary)}
html .ds22 #desk-screen .dk-bar__track{height:var(--space-3);background:var(--surface-muted);border-radius:var(--radius-xs);overflow:hidden}
html .ds22 #desk-screen .dk-bar__fill{height:100%;width:var(--w);border-radius:var(--radius-xs)}
html .ds22 #desk-screen .dk-fill--pos{background:var(--chart-income)}
html .ds22 #desk-screen .dk-fill--neg{background:var(--chart-expense)}
html .ds22 #desk-screen .dk-fill--acc{background:var(--action-primary)}
html .ds22 #desk-screen .dk-chart{display:block;width:100%;height:120px}
html .ds22 #desk-screen .dk-rect--pos{fill:var(--chart-income)}
html .ds22 #desk-screen .dk-rect--neg{fill:var(--chart-expense)}
html .ds22 #desk-screen .dk-rect--acc{fill:var(--action-primary)}
html .ds22 #desk-screen .dk-axis{display:flex;justify-content:space-between;margin-top:var(--space-1);font:var(--type-micro);color:var(--text-muted)}
/* «Деньги по месяцам»: высота столбца приходит переменной --h */
html .ds22 #desk-screen .dk-months{display:flex;align-items:flex-end;gap:var(--space-3)}
html .ds22 #desk-screen .dk-month{display:flex;flex-direction:column;align-items:center;gap:var(--space-2);flex:1;min-width:0;padding:0;border:0;background:transparent;font:inherit;color:inherit;cursor:pointer}
html .ds22 #desk-screen .dk-month__bars{display:flex;align-items:flex-end;gap:var(--space-1);height:96px}
html .ds22 #desk-screen .dk-month__bar{width:var(--space-4);height:var(--h);border-radius:var(--radius-xs)}
html .ds22 #desk-screen .dk-month__bar--in{background:var(--chart-income)}
html .ds22 #desk-screen .dk-month__bar--out{background:var(--chart-expense)}
/* период и полоса кнопок */
html .ds22 #desk-screen .dk-bar{display:flex;align-items:center;gap:var(--space-5);margin-bottom:var(--space-6)}
html .ds22 #desk-screen .dk-period{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-3);margin-bottom:var(--space-5)}
html .ds22 #desk-screen .dk-period__label{margin-left:auto;font:var(--type-micro);color:var(--text-muted)}
html .ds22 #desk-screen .dk-range{display:inline-flex;align-items:center;gap:var(--space-3);margin-left:var(--space-2);padding:var(--space-2) var(--space-4);border:1px solid var(--action-primary);border-radius:var(--radius-md)}
html .ds22 #desk-screen .dk-date{width:auto;min-width:0}
/* задолженность */
html .ds22 #desk-screen .dk-debt{font:var(--type-section-title);font-variant-numeric:tabular-nums;margin-bottom:var(--space-1)}
html .ds22 #desk-screen .dk-debt--sub{font:var(--type-subsection);margin-top:var(--space-5);margin-bottom:0}
/* окно «Настройка рабочего стола» */
html .ds22 #desk-screen .dk-cfg{max-width:560px;margin-bottom:var(--space-7);padding:var(--space-6) var(--space-7);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md)}
html .ds22 #desk-screen .dk-cfg__title{display:block;margin-bottom:var(--space-4);font:var(--type-subsection)}
html .ds22 #desk-screen .dk-opt{align-items:flex-start;padding:var(--space-2) 0}
html .ds22 #desk-screen .dk-opt--off{opacity:.55;cursor:not-allowed}
html .ds22 #desk-screen .dk-opt__why{display:block;font:var(--type-micro);color:var(--text-muted)}
html .ds22 #desk-screen .dk-vat{padding:var(--space-2) 0 var(--space-2) var(--space-9);cursor:pointer}
