/* Отчёт: нейтральная сводка, состав суммы и компактные товары в минусе. */
main.report-view { max-width: 1160px; padding: 32px 24px 64px; margin: auto; }
.report-view [hidden] { display: none !important; }
.report-view h1, .report-view h2, .report-view p { margin: 0; }
.report-view h1 { font-size: var(--type-page); line-height: 1.2; font-weight: 600; letter-spacing: -.025em; overflow-wrap: anywhere; }
.report-view h1 span { font-weight: 400; }
.report-view h1 span::before { content: "· "; }
.report-view h2 { font-size: var(--type-section); font-weight: 600; line-height: 1.25; text-wrap: balance; }
.report-view .report-back { margin-bottom: 16px; }
.report-back a { display: inline-flex; align-items: center; min-height: 44px; }
.report-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.report-heading > div { min-width: 0; }
.report-downloads { display: flex; flex-wrap: wrap; gap: 8px; }
.report-view .period-meta { margin-top: 4px; color: var(--muted); }
.download { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none; min-height: 44px; padding: 10px 20px; background: var(--primary); color: var(--primary-ink); border-radius: var(--btn-radius); font-weight: 600; font-size: var(--type-body); text-decoration: none; }
.download:hover { background: var(--primary-hover); color: var(--primary-ink); }
.view-controls { display: flex; gap: 16px; margin: 24px 0 24px; padding: 0; border-bottom: 1px solid var(--line); }
.view-controls button { min-height: 52px; margin: 0 0 -1px; padding: 10px 24px; border: 0; border-radius: 0; border-bottom: 4px solid transparent; color: var(--ink); background: transparent; box-shadow: none; font-size: var(--type-body); font-weight: 400; }
.view-controls button:hover { color: var(--primary); background: var(--soft); }
.view-controls button[aria-pressed="true"] { border-bottom-color: var(--primary); font-weight: 600; }
.overview { display: grid; grid-template-columns: minmax(0, 39fr) minmax(0, 61fr); margin-inline: -16px; padding: 24px; gap: 24px; border-radius: var(--radius); background: var(--soft); }
.outcome { min-width: 0; padding-right: 24px; border-right: 1px solid var(--line); container-type: inline-size; }
.report-view .profit { display: block; margin: 8px 0 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); font-size: min(var(--type-result), 17cqi); line-height: 1.15; letter-spacing: -.025em; font-weight: 600; white-space: nowrap; }
.report-view .profit.minus { color: var(--minus-ink); }
.report-view .profit-minor { font-size: inherit; }
.report-view .profit-compact { font-size: 13cqi; }
.report-view .profit-wide { font-size: 6.5cqi; }
.report-view .delta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; margin-top: 4px; color: var(--plus); font-weight: 600; font-size: 18px; }
.report-view .delta strong { font-weight: 600; }
.report-view .delta-label { font-size: var(--type-body); font-weight: 400; }
.report-view .delta.same { color: var(--muted); }
.report-view .delta.negative { color: var(--minus-ink); }
.data-warning { display: flex; align-items: center; gap: 12px; margin-top: 24px; padding: 12px 16px; background: var(--warn-soft); color: var(--ink); border-radius: 8px; font-size: var(--type-body); line-height: 1.3; }
.data-warning > svg { width: 28px; height: 28px; flex: none; color: var(--warn-ink); }
.data-warning p { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.data-warning a { color: var(--ink); font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.weekly-summary { min-width: 0; }
.section-heading { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.sold { margin-left: auto; font-size: 16px; white-space: nowrap; }
.summary-bands { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.summary-band { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 10px 12px; font-size: var(--type-body); isolation: isolate; }
.summary-band > svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; fill: var(--summary-band); }
.summary-band strong { white-space: nowrap; font-weight: 600; }
.summary-band.negative > svg { fill: var(--minus-soft); }
.summary-band.negative strong { color: var(--minus-ink); }
.report-analytics { display: grid; grid-template-columns: minmax(0, 57fr) minmax(0, 43fr); gap: 32px; margin-top: 28px; }
.composition-section { min-width: 0; position: relative; }
.products-section { min-width: 0; border-left: 1px solid var(--line); padding-left: 32px; }
.report-view .count { font-weight: 400; font-size: .8em; white-space: nowrap; }
.composition-bar { display: block; width: 100%; height: 56px; margin-top: 24px; border-radius: 6px; overflow: hidden; }
.composition-percentages { height: 56px; margin-top: -56px; pointer-events: none; }
.composition-percentages svg { display: block; width: 100%; height: 56px; font: 600 29px var(--font); fill: var(--ink); }
.composition-percentages .label-profit { fill: white; }
.part-cogs { fill: var(--chart-cogs); background: var(--chart-cogs); }
.part-fees { fill: var(--chart-fees); background: var(--chart-fees); }
.part-tax { fill: var(--accent); background: var(--accent); }
.part-other { fill: var(--chart-other); background: var(--chart-other); }
.part-profit { fill: var(--plus); background: var(--plus); }
.composition-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; margin: 24px 0 0; font-size: var(--type-body); }
.composition-legend > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.composition-legend dt { display: flex; align-items: center; gap: 8px; }
.composition-legend dt svg { width: 22px; height: 22px; flex: none; }
.composition-legend dd { margin: 0 0 0 auto; font-weight: 600; white-space: nowrap; }
.swatch { width: 14px; height: 14px; flex: none; border-radius: 3px; }
.composition-note { padding-top: 16px; color: var(--muted); font-size: 14px; }
.composition-signed { margin-top: 16px; }
.product-chart { margin-top: 24px; }
.product-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(40px, 25%) auto; align-items: center; gap: 16px; min-height: 56px; border-bottom: 1px solid var(--line); font-size: var(--type-body); }
.product-row:last-child { border: 0; }
.product-name { padding: 8px 0; overflow-wrap: anywhere; }
.product-name small { display: block; color: var(--warn-ink); font-size: 14px; }
.product-row strong { font-size: inherit; font-weight: 500; white-space: nowrap; text-align: right; }
.product-track { display: block; width: 100%; height: 14px; overflow: visible; }
.product-track rect { fill: var(--plus); }
.product-track line { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.is-loss .product-track rect { fill: var(--minus); }
.is-incomplete .product-track rect { fill: var(--chart-other); }
.report-view .section-note { margin-top: 12px; color: var(--muted); font-size: 14px; max-width: 65ch; }
.report-view .report-empty, .report-view .report-unavailable { padding: 24px 0; color: var(--muted); }
.expanded-data { margin-top: 40px; }
.report-disclosure { border-top: 1px solid var(--line); }
.report-disclosure:last-child { border-bottom: 1px solid var(--line); }
.report-disclosure > summary { padding: 16px 0; min-height: 56px; cursor: pointer; font-weight: 600; }
.report-disclosure > summary::marker { color: var(--primary); }
.disclosure-content { padding: 8px 0 24px; }
.accounting-list { max-width: 740px; margin: 0; }
.accounting-list > div { display: flex; justify-content: space-between; gap: 24px; padding: 8px 0; }
.accounting-list dd { margin: 0; white-space: nowrap; }
.accounting-list .subtotal { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; font-weight: 600; }
.report-view .table-scroll { overflow-x: auto; padding-bottom: 20px; }
.report-view .table-note, .report-view .table-scroll-hint { margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.table-scroll-hint { display: none; }
.table-scroll-hint.is-visible { display: block; }
.report-view table { border-collapse: collapse; width: 100%; min-width: 830px; margin: 0; box-shadow: none; font-size: 14px; }
.report-view th { color: var(--muted); font-weight: 600; text-align: right; }
.report-view th:first-child, .report-view td:first-child { text-align: left; }
.report-view th:first-child { position: sticky; left: 0; z-index: 1; min-width: 170px; max-width: 190px; background: var(--bg); border-right: 1px solid var(--line); white-space: normal; overflow-wrap: anywhere; }
.report-view td { text-align: right; white-space: nowrap; }
.report-view td, .report-view th { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); }
.report-view .missing { color: var(--warn-ink); }
.report-pagination { display: flex; align-items: center; gap: 24px; padding-top: 16px; }
.report-pagination a { display: inline-flex; min-height: 44px; align-items: center; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 1100px) {
  .overview { grid-template-columns: minmax(0, 43fr) minmax(0, 57fr); }
  .weekly-summary .section-heading { flex-wrap: wrap; gap: 0 8px; }
  .sold { flex-basis: 100%; margin: 4px 0 0; }
  .composition-legend { grid-template-columns: 1fr; gap: 12px; }
  .report-analytics { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
  .products-section { padding-left: 24px; }
  .product-row { gap: 10px; grid-template-columns: minmax(0, 1fr) 48px auto; }
  .summary-band { flex-wrap: wrap; gap: 2px; }
  .summary-band > span { flex-basis: 100%; }
  .summary-band strong { margin-left: auto; }
}
@media (max-width: 700px) {
  main.report-view { padding: 16px 20px 48px; }
  .report-heading { flex-wrap: wrap; gap: 16px; }
  .report-view h1 span { display: block; font-size: .8em; margin-top: 4px; }
  .report-view h1 span::before { content: none; }
  .download { min-height: 44px; font-size: 16px; padding: 8px 16px; }
  .view-controls { margin: 20px 0; }
  .view-controls button { font-size: var(--type-body); padding: 10px 16px; width: auto; }
  .overview { grid-template-columns: 1fr; margin-inline: -8px; padding: 20px 16px; gap: 24px; }
  .outcome { padding: 0 0 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .report-view .profit { font-size: min(var(--type-result), 16cqi); }
  .report-view .profit-compact { font-size: 13cqi; }
  .report-view .profit-wide { font-size: 6.5cqi; }
  .report-view h2 { font-size: 20px; }
  .data-warning { padding: 10px 12px; font-size: 14px; }
  .weekly-summary .sold { flex-basis: auto; margin-left: auto; font-size: 14px; }
  .summary-band { font-size: 16px; padding: 10px; }
  .summary-band > span { flex-basis: auto; }
  .summary-band strong { margin-left: auto; }
  .report-analytics { grid-template-columns: 1fr; gap: 32px; }
  .products-section { padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .composition-legend { grid-template-columns: 1fr; font-size: 14px; }
  .composition-percentages svg { font-size: 42px; }
  .composition-percentages .label-tax { display: none; }
  .product-row { grid-template-columns: minmax(0, 1fr) minmax(40px, 25%) auto; min-height: 56px; font-size: 16px; }
  .product-row strong { font-size: 14px; }
  .accounting-list dd { white-space: normal; text-align: right; }
  .report-view:not(.scroll-hint-ready) .table-scroll-hint { display: block; }
}
@media print {
  .top, .view-controls, .download, .help, .report-back { display: none !important; }
  main.report-view { padding: 0; }
  .overview, .report-analytics { break-inside: avoid; }
}

/* Выбор периода в самом отчёте. */
.report-topline {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 16px;
  font-size: 14px;
}
.report-topline a { display: inline-flex; align-items: center; min-height: 44px; }
.report-topline a:last-child { color: var(--muted); }
.report-context { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.period-choice { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.period-choice select {
  margin: 0;
  min-height: 44px;
  width: auto;
  max-width: 100%;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--field-border);
  border-radius: var(--btn-radius);
  background-color: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  cursor: pointer;
}
.archive-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }
@media (max-width: 780px) {
  .report-heading { align-items: flex-start; flex-wrap: wrap; gap: 16px; }
  .report-context { gap: 12px; }
  .period-choice select { font-size: 16px; }
}
@media (max-width: 480px) {
  .report-context { display: block; width: 100%; }
  .period-choice { margin-top: 12px; gap: 8px 16px; }
  .report-heading .download { width: auto; }
}

/* Shared workspace alignment wins over legacy report-only widths. */
main.report-view { max-width:1208px; padding:28px 24px 64px; }
.report-view .path-nav .path-title { font-size:20px; line-height:1.3; letter-spacing:0; }
.report-view .path-nav .path-title span::before { content:none; }
@media(max-width:760px) { main.report-view { padding:20px 16px 48px; } .report-view .path-nav .path-title { font-size:16px; } .report-heading { align-items:flex-start; flex-direction:column; gap:12px; } }
