.report-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
}

.report-heading h1 {
  margin: 0;
}

.report-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f9fb;
  color: #435d70;
  font-size: 12px;
  font-weight: 600;
}

.report-status-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e5edf4;
  color: #36546b;
  font: 700 12px/1 'Segoe UI Symbol', sans-serif;
}

[data-state='running'] .report-status-icon {
  border: 2px solid #a6d5ce;
  border-top-color: #14776b;
  background: transparent;
  animation: report-status-spin 0.85s linear infinite;
}

[data-state='complete'] .report-status-icon {
  background: #dff3e7;
  color: #1c6b47;
}

[data-state='error'] .report-status-icon,
[data-state='denied'] .report-status-icon {
  background: #fbe6e7;
  color: #a33239;
}

[data-state='pending'] .report-status-icon,
[data-state='no-units'] .report-status-icon {
  background: #f6edd7;
  color: #775b22;
}

@keyframes report-status-spin {
  to { transform: rotate(1turn); }
}

@media (prefers-reduced-motion: reduce) {
  [data-state='running'] .report-status-icon {
    animation: none;
  }
}

.report-message:empty {
  display: none;
}

.report-filters {
  margin-top: 20px;
  scroll-margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbfd;
}

.report-filters-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 11px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.report-filters-toggle::-webkit-details-marker {
  display: none;
}

.report-filters-toggle::after {
  width: 7px;
  height: 7px;
  margin-inline-end: 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  content: '';
}

.report-filters[open] > .report-filters-toggle {
  border-bottom: 1px solid var(--line);
  border-radius: 11px 11px 0 0;
}

.report-filters[open] > .report-filters-toggle::after {
  transform: translateY(2px) rotate(225deg);
}

.report-filters-toggle:hover {
  background: #eef5f9;
}

.report-filters-toggle:focus-visible {
  outline-offset: -3px;
}

.report-form {
  display: grid;
  gap: 16px;
  padding: 16px 18px 18px;
}

.report-fields,
.report-period {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.report-fields {
  display: grid;
  gap: 14px;
}

.report-period {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.report-period legend {
  margin-bottom: 6px;
  padding: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 650;
}

.report-filter-grid {
  display: grid;
  grid-template-columns: minmax(250px, 1.25fr) repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 14px;
}

.report-filter-wide {
  grid-column: 1 / -1;
}

.report-fields label {
  margin-bottom: 0;
  color: #40576b;
  font-size: 12px;
}

.report-fields input[type='date'] {
  min-width: 0;
  padding-inline: 8px;
}

.report-fields textarea {
  display: block;
  width: 100%;
  min-height: 42px;
  margin-top: 7px;
  padding: 8px 10px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

.report-options {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.report-options > summary {
  min-height: 41px;
  padding: 11px 10px;
  cursor: pointer;
  color: var(--primary);
  font-size: 12px;
  font-weight: 650;
}

.report-options summary span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.report-option-body {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.report-option-list {
  display: grid;
  align-content: start;
  gap: 4px;
  max-height: 164px;
  overflow: auto;
  overscroll-behavior: contain;
}

.report-option-list label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 3px 2px;
  font-weight: 400;
}

.report-option-list input[type='checkbox'] {
  flex: none;
  width: auto;
  margin: 2px 0 0;
  accent-color: #16887b;
}

.report-options-actions,
.report-actions,
.report-pager {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.report-options-actions button {
  padding: 5px 7px;
  font-size: 11px;
}

.report-options-more {
  justify-self: start;
  padding: 5px 7px;
  font-size: 11px;
}

.report-characteristic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr));
  align-items: start;
  gap: 11px;
  padding: 0 10px 10px;
}

.report-actions button,
.report-pager button {
  min-height: 36px;
  font-size: 12px;
}

.report-message {
  margin: 0;
  color: var(--primary);
}

.report-message[data-error] {
  color: #9c3930;
}

.report-filters + .report-message {
  margin-top: 10px;
}

.report-results {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.report-results-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px 12px;
}

.report-results-heading p {
  margin: 0;
  font-size: 12px;
}

.report-results-heading h2 {
  scroll-margin-top: 14px;
}

.report-grouping {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.report-group-drop {
  min-width: 0;
  min-height: 62px;
  padding: 9px 12px;
  border: 1px dashed #a6becf;
  border-radius: 8px;
  background: #f6fafc;
}

.report-group-drop h3 {
  margin: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.report-group-drop p {
  margin: 4px 0 0;
  font-size: 12px;
}

.report-group-dragging {
  border-color: #16887b;
}

.report-group-over {
  background: #e8f6f3;
  box-shadow: inset 0 0 0 1px #16887b;
}

.report-group-controls,
.report-group-add,
.report-group-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.report-group-fields {
  --group-gap: 15px;
  --group-step: min(10px, calc(44px / var(--group-steps, 1)));
  display: flex;
  align-items: flex-start;
  gap: var(--group-gap);
  margin: 7px 0 0;
  padding: 4px;
  overflow: auto;
  scrollbar-width: thin;
  list-style: none;
}

.report-group-chip {
  --group-offset: calc(var(--group-level) * var(--group-step));
  position: relative;
  display: flex;
  flex: none;
  align-items: stretch;
  max-width: min(300px, 100%);
  margin-block-start: var(--group-offset);
  border: 1px solid #cadce8;
  border-radius: 6px;
  background: #fff;
  cursor: grab;
}

.report-group-chip + .report-group-chip::after {
  position: absolute;
  top: calc(50% - var(--group-step));
  inset-inline-end: 100%;
  width: calc(var(--group-gap) + 1px);
  height: calc(var(--group-step) + 1px);
  border-inline-start: 1px solid #8ba6ba;
  border-block-end: 1px solid #8ba6ba;
  border-end-start-radius: 4px;
  pointer-events: none;
  content: '';
}

.report-group-chip[data-drop-side]::before {
  position: absolute;
  z-index: 1;
  inset-block: 0;
  width: 2px;
  border-radius: 2px;
  background: #16887b;
  pointer-events: none;
  content: '';
}

.report-group-chip[data-drop-side='before']::before {
  inset-inline-start: -5px;
}

.report-group-chip[data-drop-side='after']::before {
  inset-inline-end: -5px;
}

.report-group-chip-button {
  min-width: 24px;
  min-height: 29px;
  padding: 2px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 15px;
}

.report-group-chip-button:focus-visible {
  outline-offset: -2px;
}

.report-group-chip-button:disabled,
.report-group-controls button:disabled {
  cursor: default;
}

.report-group-chip-name {
  gap: 7px;
  min-width: 0;
  padding-inline: 8px;
  font-size: 12px;
  font-weight: 650;
  text-align: left;
  cursor: grab;
}

.report-group-chip-name::after {
  flex: none;
  border-inline: 4px solid transparent;
  border-block-end: 5px solid currentColor;
  content: '';
}

.report-group-chip-name[data-direction='descending']::after {
  transform: rotate(180deg);
}

.report-group-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-group-controls {
  justify-content: space-between;
}

.report-group-add {
  flex-wrap: nowrap;
}

.report-group-add select {
  min-width: 0;
  max-width: min(270px, 100%);
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--primary);
  font: inherit;
  font-size: 12px;
}

.report-group-controls button {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 12px;
}

.report-table-scroll {
  max-height: 52vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.report-table-scroll table {
  width: 100%;
  border-spacing: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.report-table-scroll th,
.report-table-scroll td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.report-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eaf2f8;
  color: var(--primary);
}

.report-table-scroll th button {
  padding: 1px 0;
  border: 0;
  background: transparent;
  font-weight: 650;
  white-space: nowrap;
}

.report-table-scroll th[draggable='true'],
.report-table-scroll th button[draggable='true'] {
  cursor: grab;
}

.report-table-scroll th[aria-sort='ascending'] button::after {
  content: '↑';
}

.report-table-scroll th[aria-sort='descending'] button::after {
  content: '↓';
}

.report-table-scroll .report-number {
  text-align: right;
}

.report-table-scroll tbody tr:nth-child(even) {
  background: #f7fafc;
}

.report-table-scroll .report-group-row td {
  padding: 5px 10px;
  border-bottom-color: #d7e5ee;
  background: #f0f6fa;
  white-space: normal;
}

.report-table-scroll .report-group-row[data-depth='0'] td {
  background: #e5f0f6;
}

.report-table-scroll .report-group-continued td {
  border-top: 1px dashed #a6becf;
}

.report-group-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 12px;
  width: fit-content;
  max-width: 100%;
  padding-inline-start: calc(14px * var(--group-depth));
  color: #294e68;
}

.report-group-row-toggle {
  justify-content: flex-start;
  gap: 8px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  text-align: left;
}

.report-group-row-toggle::before {
  flex: none;
  width: 5px;
  height: 5px;
  margin-inline: 1px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  content: '';
}

.report-group-row-toggle[aria-expanded='true']::before {
  transform: rotate(45deg) translateY(-1px);
}

.report-group-caption {
  overflow-wrap: anywhere;
}

.report-group-count {
  color: #4f6576;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.report-subtotal-row > * {
  border-top: 1px solid #d7e5ee;
  background: #f0f6fa;
  color: #294e68;
  font-weight: 650;
}

.report-subtotal-row[data-depth='0'] > * {
  background: #e5f0f6;
}

.report-table-scroll .report-total-row > * {
  position: sticky;
  bottom: 0;
  z-index: 1;
  border-top: 1px solid #a6becf;
  border-bottom: 0;
  background: #eaf2f8;
  color: var(--primary);
  font-weight: 700;
}

.report-summary-caption {
  display: block;
  max-inline-size: 26ch;
  padding-inline-start: calc(8px * var(--group-depth, 0));
  overflow: hidden;
  text-align: start;
  text-overflow: ellipsis;
}

.report-summary-operation {
  color: #4f6576;
  font-size: 11px;
  font-weight: 500;
}

.report-pager {
  justify-content: flex-end;
  color: #536d80;
  font-size: 12px;
}

.report-pager button:disabled {
  cursor: default;
}

@media (max-width: 1050px) {
  .report-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .report-period {
    grid-column: 1 / -1;
  }
}

@media (max-width: 650px) {
  .report-filters-toggle {
    padding-inline: 13px;
  }

  .report-form {
    padding: 13px;
  }

  .report-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-fields textarea {
    font-size: 16px;
  }

  .report-group-add {
    width: 100%;
  }

  .report-group-add select {
    flex: 1;
    font-size: 16px;
  }

  .report-group-fields {
    --group-gap: 8px;
    flex-direction: column;
    max-height: min(40vh, 260px);
  }

  .report-group-chip {
    max-width: calc(100% - var(--group-offset));
    margin-block-start: 0;
    margin-inline-start: var(--group-offset);
  }

  .report-group-chip + .report-group-chip::after {
    top: calc(-1px - var(--group-gap));
    width: calc(var(--group-step) + 1px);
    height: calc(50% + var(--group-gap) + 1px);
  }

  .report-group-chip[data-drop-side]::before {
    inset-inline: 0;
    width: auto;
    height: 2px;
  }

  .report-group-chip[data-drop-side='before']::before {
    inset-block: -5px auto;
  }

  .report-group-chip[data-drop-side='after']::before {
    inset-block: auto -5px;
  }

  .report-group-chip-button {
    min-width: 32px;
    min-height: 35px;
  }

  .report-group-chip-button:is([data-group-action='left'], [data-group-action='right']) > span {
    transform: rotate(90deg);
  }

  .report-group-line {
    max-width: max(170px, calc(100vw - 95px));
    padding-inline-start: calc(10px * var(--group-depth));
  }

  .report-pager {
    justify-content: space-between;
  }
}
