/* Reusable reporting presentation. All business values are supplied by callers. */
:root {
  --ws-chart-1: var(--ws-color-action);
  --ws-chart-2: #315c8a;
  --ws-chart-3: #7862a5;
  --ws-chart-4: #967020;
}
.ws-report-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: var(--ws-space-4);
}
.ws-metric-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--ws-color-line);
  border-radius: var(--ws-card-radius);
  background: var(--ws-color-surface);
  color: var(--ws-color-ink);
}
.ws-metric-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: var(--ws-type-label);
  color: var(--ws-color-muted);
}
.ws-metric-symbol {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--ws-color-mint);
  color: var(--ws-color-action);
  flex: none;
}
.ws-metric-symbol .ws-icon {
  width: 18px;
  height: 18px;
}
.ws-metric-value {
  font-size: 28px;
  line-height: 36px;
  letter-spacing: -0.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ws-metric-period {
  font: var(--ws-type-small);
  color: var(--ws-color-muted);
}
.ws-metric-change {
  display: flex;
  align-items: center;
  gap: 5px;
  font: var(--ws-type-small);
  color: var(--ws-color-muted);
}
.ws-metric-change .ws-icon {
  width: 14px;
  height: 14px;
  flex: none;
}
.ws-metric-change--good {
  color: var(--ws-color-action-hover);
}
.ws-metric-change--bad {
  color: var(--ws-color-danger);
}
.ws-metric-basis,
.ws-metric-note {
  font: var(--ws-type-small);
  color: var(--ws-color-muted);
  margin: 4px 0 0;
}
.ws-metric-basis {
  margin-top: auto;
  padding-top: 8px;
}
.ws-metric-note {
  border-top: 1px dashed var(--ws-color-line);
  padding-top: 8px;
}
.ws-sparkline {
  width: 120px;
  height: 32px;
  display: block;
  margin-top: 4px;
}
.ws-sparkline path {
  fill: none;
  stroke: var(--ws-color-action);
  stroke-width: 1.7;
  vector-effect: non-scaling-stroke;
}
.ws-metric-card.is-loading .ws-metric-value {
  font: var(--ws-type-heading);
  color: var(--ws-color-muted);
}
.ws-report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr);
  gap: var(--ws-space-4);
}
.ws-report-layout > * {
  min-width: 0;
}
.ws-report-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ws-space-4);
  min-width: 0;
}
.ws-report-layout .ws-surface {
  height: 100%;
}
.ws-report-basis,
.ws-report-note,
.ws-report-total {
  font: var(--ws-type-small);
  color: var(--ws-color-muted);
  margin: 12px 0 0;
}
.ws-report-basis + .ws-disclosure {
  margin-top: 16px;
}
.ws-report-total strong {
  color: var(--ws-color-ink);
  font-variant-numeric: tabular-nums;
}
.ws-chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font: var(--ws-type-small);
  margin-bottom: 8px;
}
.ws-chart-legend > span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}
.ws-series-key {
  width: 18px;
  height: 0;
  display: inline-block;
  border-top: 3px solid var(--ws-chart-1);
  flex: none;
}
.ws-series-key.ws-series-1 {
  border-color: var(--ws-chart-2);
  border-top-style: dashed;
}
.ws-series-key.ws-series-2 {
  border-color: var(--ws-chart-3);
  border-top-style: dotted;
}
.ws-series-key.ws-series-3 {
  border-color: var(--ws-chart-4);
  border-top-style: double;
}
.ws-chart-plot {
  overflow: auto;
  max-width: 100%;
}
.ws-series-chart {
  display: block;
  width: 100%;
  min-width: 480px;
  height: auto;
}
.ws-chart-axis {
  fill: var(--ws-color-muted);
  font-family: var(--ws-font-family);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.ws-chart-grid {
  stroke: var(--ws-color-line);
  stroke-dasharray: 3 4;
  stroke-width: 1;
}
.ws-chart-zero {
  stroke: var(--ws-color-control);
  stroke-width: 1;
}
.ws-chart-line {
  fill: none;
  stroke-width: 2.5;
  stroke: var(--ws-chart-1);
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.ws-chart-line.ws-series-1 {
  stroke: var(--ws-chart-2);
  stroke-dasharray: 6 4;
}
.ws-chart-line.ws-series-2 {
  stroke: var(--ws-chart-3);
  stroke-dasharray: 2 4;
}
.ws-chart-line.ws-series-3 {
  stroke: var(--ws-chart-4);
  stroke-dasharray: 10 4 2 4;
}
.ws-chart-fill {
  fill: var(--ws-chart-1);
  opacity: 0.08;
}
.ws-chart-fill.ws-series-1 {
  fill: var(--ws-chart-2);
}
.ws-chart-fill.ws-series-2 {
  fill: var(--ws-chart-3);
}
.ws-chart-fill.ws-series-3 {
  fill: var(--ws-chart-4);
}
.ws-chart-dot {
  fill: var(--ws-color-surface);
  stroke: var(--ws-chart-1);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.ws-chart-dot.ws-series-1 {
  stroke: var(--ws-chart-2);
}
.ws-chart-dot.ws-series-2 {
  stroke: var(--ws-chart-3);
}
.ws-chart-dot.ws-series-3 {
  stroke: var(--ws-chart-4);
}
.ws-report-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 180px;
  background: var(--ws-color-sunk);
  border: 1px dashed var(--ws-color-control);
  border-radius: var(--ws-control-radius);
  padding: 20px;
  text-align: center;
  font: var(--ws-type-body);
}
.ws-report-empty > .ws-icon {
  width: 28px;
  height: 28px;
  color: var(--ws-color-action);
}
.ws-report-empty p {
  font: var(--ws-type-small);
  color: var(--ws-color-muted);
  margin: 0;
  max-width: 340px;
}
.ws-category-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}
.ws-bar-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font: var(--ws-type-body);
  margin-bottom: 8px;
}
.ws-bar-heading > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ws-bar-heading strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ws-bar-track {
  display: block;
  width: 100%;
  height: 12px;
  background: var(--ws-color-sunk);
  border-radius: 3px;
}
.ws-bar-value {
  fill: var(--ws-color-action);
}
.ws-bar-value.is-negative {
  fill: var(--ws-color-danger);
}
.ws-bar-zero {
  stroke: var(--ws-color-control);
  stroke-width: 0.3;
  vector-effect: non-scaling-stroke;
}
.ws-distribution {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.ws-distribution > svg {
  width: 160px;
  height: 160px;
  flex: none;
  max-width: 100%;
}
.ws-donut-track {
  fill: none;
  stroke: var(--ws-color-line);
  stroke-width: 18;
}
.ws-donut-part {
  fill: none;
  stroke: var(--ws-chart-1);
  stroke-width: 18;
}
.ws-donut-part.ws-series-1 {
  stroke: var(--ws-chart-2);
}
.ws-donut-part.ws-series-2 {
  stroke: var(--ws-chart-3);
}
.ws-donut-part.ws-series-3 {
  stroke: var(--ws-chart-4);
}
.ws-donut-label {
  font-family: var(--ws-font-family);
  font-size: 11px;
  fill: var(--ws-color-muted);
}
.ws-donut-total {
  font-family: var(--ws-font-family);
  font-size: 13px;
  font-weight: 600;
  fill: var(--ws-color-ink);
}
.ws-distribution-list {
  list-style: none;
  padding: 0;
  margin: 0;
  min-width: 0;
  flex: 1 1 200px;
  display: grid;
  gap: 12px;
  width: 100%;
}
.ws-distribution-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  font: var(--ws-type-body);
}
.ws-distribution-list li > span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ws-distribution-list strong {
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ws-distribution-list small {
  grid-column: 2;
  color: var(--ws-color-muted);
  text-align: right;
  font: var(--ws-type-small);
}
.ws-report-table tbody th {
  font: var(--ws-type-body);
  color: var(--ws-color-ink);
  background: var(--ws-color-surface);
}
.ws-report-table thead .ws-button {
  padding: 0;
  min-height: 32px;
  font: var(--ws-type-label);
  color: var(--ws-color-muted);
}
.ws-report-table .ws-numeric .ws-button {
  justify-content: flex-end;
  width: 100%;
}
.ws-report-table tfoot :is(th, td) {
  border-top: 2px solid var(--ws-color-line);
  font-weight: 600;
  background: var(--ws-color-sunk);
}
.ws-report-table thead [aria-sort] .ws-button {
  color: var(--ws-color-action);
}
.ws-report-toolbar {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  background: var(--ws-color-sunk);
  border: 1px solid var(--ws-color-line);
  border-radius: var(--ws-card-radius);
}
.ws-report-toolbar > div {
  flex: 1 1 160px;
  max-width: 220px;
}
.ws-report-toolbar > .ws-button {
  margin-top: 24px;
}
.ws-report-range-error {
  flex-basis: 100%;
  margin: 0;
  color: var(--ws-color-danger);
  font: var(--ws-type-small);
}
.ws-report-range-error[hidden] {
  display: none !important;
}
.ws-summary-facts {
  display: grid;
  gap: 12px;
  margin: 0;
  font: var(--ws-type-body);
}
.ws-summary-facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.ws-summary-facts dt {
  color: var(--ws-color-muted);
}
.ws-summary-facts dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.ws-summary-facts .ws-summary-total {
  border-top: 1px solid var(--ws-color-line);
  padding-top: 14px;
  margin-top: 4px;
}
.ws-summary-total :is(dt, dd) {
  font-size: 18px;
  font-weight: 600;
  color: var(--ws-color-ink);
}
.ws-detail-card {
  border: 1px solid var(--ws-color-line);
  border-radius: var(--ws-card-radius);
  background: var(--ws-color-surface);
  padding: 20px;
  min-width: 0;
}
.ws-detail-card > header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.ws-detail-card h3 {
  font: var(--ws-type-heading);
  margin: 0;
}
.ws-detail-card header p {
  font: var(--ws-type-small);
  margin: 3px 0 0;
  color: var(--ws-color-muted);
}
.ws-detail-icon {
  display: grid;
  place-items: center;
  background: var(--ws-color-mint);
  color: var(--ws-color-action);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex: none;
}
.ws-detail-icon svg {
  width: 20px;
  height: 20px;
}
.ws-detail-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
  font: var(--ws-type-body);
}
.ws-detail-card dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.ws-detail-card dt {
  color: var(--ws-color-muted);
}
.ws-detail-card dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
  min-width: 0;
}
.ws-detail-card footer {
  border-top: 1px solid var(--ws-color-line);
  padding-top: 16px;
  margin-top: 20px;
}
@media (max-width: 1100px) {
  .ws-report-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .ws-report-metrics {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  }
}
@media (max-width: 760px), (pointer: coarse) {
  .ws-report-table thead .ws-button {
    min-height: 44px;
  }
  .ws-report-toolbar > div {
    max-width: none;
  }
  .ws-report-toolbar > .ws-button {
    margin-top: 0;
  }
  .ws-metric-card,
  .ws-detail-card {
    padding: 16px;
  }
  .ws-metric-value {
    font-size: 26px;
    line-height: 34px;
  }
  .ws-bar-heading {
    flex-wrap: wrap;
  }
  .ws-distribution {
    justify-content: center;
  }
  .ws-summary-facts > div {
    flex-wrap: wrap;
  }
}
@media print {
  .ws-chart-plot {
    overflow: visible;
  }
  .ws-series-chart {
    min-width: 0;
  }
  .ws-report-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .ws-metric-card,
  .ws-surface,
  .ws-detail-card {
    break-inside: avoid;
  }
  .ws-report-toolbar {
    display: none;
  }
  .ws-chart-grid {
    stroke: #ccc;
  }
}
