/* =============================================================================
   ERP Holzbau – charts.css: SVG-Diagramme aus js/charts/charts.js.
   Farben ausschließlich über --viz-*-Tokens (tokens.css), damit Light/Dark passen.
   ============================================================================= */
.viz {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.viz-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--viz-ink-2);
}
.viz-plot {
  min-width: 0;
  overflow-x: auto;
}
.viz-svg {
  display: block;
  width: 100%;
  height: 100%;
  font-family: var(--viz-font);
  overflow: visible;
}
.viz-bars {
  height: 100%;
}
.viz-lines {
  height: auto;
}
.viz-gridline {
  stroke: var(--viz-grid);
  stroke-width: 1;
}
.viz-label {
  fill: var(--viz-ink-2);
  font-size: 12px;
}
.viz-value {
  fill: var(--viz-ink-1);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.viz-axis-label {
  fill: var(--viz-ink-3);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}
.viz-bar {
  transition: opacity 120ms;
}
.viz-bar-row.clickable {
  cursor: pointer;
}
.viz-bar-row.clickable:hover .viz-bar,
.viz-bar-row:focus-visible .viz-bar {
  opacity: 0.8;
}
.viz-bar-row:focus-visible {
  outline: none;
}
.viz-bar-row:focus-visible .viz-bar {
  stroke: var(--viz-ink-1);
  stroke-width: 1.5;
}
.viz-line {
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.viz-area {
  opacity: 0.14;
}
.viz-dot {
  stroke: var(--viz-surface);
  stroke-width: 1.5;
}
.viz-empty {
  padding: 24px;
  text-align: center;
}
.viz-caption {
  line-height: 1.3;
}

/* Ring */
.viz-donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.viz-donut {
  flex: 0 0 auto;
}
.viz-arc {
  transition: stroke-dasharray 300ms ease;
}
.viz-center-value {
  fill: var(--viz-ink-1);
  font-size: 22px;
  font-weight: 600;
}
.viz-center-label {
  fill: var(--viz-ink-3);
  font-size: 11px;
}

/* Legende */
.viz-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12px;
  color: var(--viz-ink-2);
}
.viz-legend.vertical {
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}
.viz-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.viz-legend .viz-legend-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.viz-legend .viz-legend-value {
  margin-left: auto;
  padding-left: 8px;
}
.viz-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: 0 0 auto;
}

/* Meter */
.viz-meter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.viz-meter-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.viz-meter-label {
  color: var(--viz-ink-1);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.viz-meter-val {
  color: var(--viz-ink-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.viz-meter-track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: var(--viz-meter-track);
  overflow: hidden;
}
.viz-meter-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--viz-meter-fill);
  transition: width 300ms ease;
}
.viz-meter.tone-warning .viz-meter-fill {
  background: var(--viz-warning);
}
.viz-meter.tone-critical .viz-meter-fill {
  background: var(--viz-critical);
}
.viz-meter.tone-good .viz-meter-fill {
  background: var(--viz-meter-fill);
}
.viz-meter-mark {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: var(--viz-ink-3);
}

/* Sparkline */
.viz-spark {
  display: inline-block;
  vertical-align: middle;
}

/* Tabellen-Zwilling nur für Bildschirmleser */
.viz table.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Druck: Farben erhalten */
@media print {
  .viz-svg,
  .viz-meter-fill,
  .viz-swatch {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
