/* Reporting: period, key figures, monthly chart and breakdown bars. */
.reporting-switch .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.reporting-switch .btn.active {
  border-color: var(--ui-accent);
  background: color-mix(in srgb, var(--ui-accent) 16%, white);
  color: var(--ui-text);
  font-weight: 600;
}

.reporting-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

.reporting-period .btn-group {
  flex-wrap: wrap;
}

.reporting-period-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.reporting-period-dates .form-label {
  margin: 0;
  font-weight: 600;
}

.reporting-period-dates .form-control {
  width: auto;
  margin-bottom: 0;
}

.reporting-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
}

.reporting-filters .mb-3 {
  margin-bottom: 0 !important;
}

.reporting-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.reporting-figures {
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.reporting-graphs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 0.75rem;
}

.reporting-graphs[hidden] {
  display: none;
}

.reporting-graphs .is-wide {
  grid-column: 1 / -1;
}

.reporting-graphs .card,
.reporting-data-card {
  margin-bottom: 0;
}

.reporting-graphs .card-header,
.reporting-data-card .card-header {
  background: color-mix(in srgb, var(--ui-accent) 8%, white);
  border-bottom-color: color-mix(in srgb, var(--ui-accent) 22%, white);
}

.reporting-graphs .card-title,
.reporting-data-card .card-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: var(--ui-text);
  font-size: 0.95rem;
}

.reporting-card-select {
  flex: 0 0 16rem;
  min-width: 0;
  max-width: 100%;
}

.reporting-card-select .ts-control {
  flex-wrap: nowrap;
  white-space: nowrap;
}

.reporting-chart {
  position: relative;
  height: 300px;
}

.reporting-chart--tall {
  height: 400px;
}

.reporting-bars {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reporting-bar {
  display: grid;
  grid-template-columns: minmax(7rem, 12rem) minmax(4rem, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.reporting-bar-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.reporting-bar-key {
  flex: none;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 0.2rem;
  background: var(--bar-color);
}

.reporting-bar-track {
  height: 0.6rem;
  border-radius: 999px;
  background: rgba(var(--tblr-secondary-rgb), 0.08);
}

.reporting-bar-fill {
  display: block;
  width: var(--bar);
  min-width: 0.6rem;
  height: 100%;
  border-radius: 999px;
  background: var(--bar-color, var(--bar-default, var(--chart-1)));
}

.reporting-bar-value {
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.reporting-bar-total {
  color: var(--tblr-secondary-color);
  font-weight: 400;
}

.reporting-empty {
  margin: 0;
  color: var(--tblr-secondary-color);
  text-align: center;
}

html[data-bs-theme="dark"] .reporting-switch .btn.active {
  background: color-mix(in srgb, var(--ui-accent) 22%, var(--app-dark-surface));
}

html[data-bs-theme="dark"] .reporting-graphs .card-header,
html[data-bs-theme="dark"] .reporting-data-card .card-header {
  background: color-mix(in srgb, var(--ui-accent) 12%, var(--app-dark-surface-toolbar));
  border-bottom-color: var(--app-dark-border);
}

html[data-bs-theme="dark"] .reporting-bar-track {
  background: var(--app-dark-overlay);
}

@media (max-width: 575.98px) {
  .reporting-bar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .reporting-bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .reporting-card-select {
    flex-basis: 100%;
  }
}
