/* Reports page. */

.import-progress-track {
  width: 100%;
  height: 14px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-subtle);
  overflow: hidden;
  margin: var(--space-3) 0;
}
.import-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-primary);
  transition: width 0.2s linear;
}

.report-row-clickable {
  cursor: pointer;
}
.report-row-clickable:hover {
  background: var(--color-surface-alt);
}

/* Fixed column widths so the report table fits the screen width instead of needing horizontal
   scroll; overflowing cell text truncates with an ellipsis (full text is in the title tooltip). */
.report-data-table {
  table-layout: fixed;
}
.report-data-table th:nth-child(1), .report-data-table td:nth-child(1) { width: 14%; }
.report-data-table th:nth-child(2), .report-data-table td:nth-child(2) { width: 8%; }
.report-data-table th:nth-child(3), .report-data-table td:nth-child(3) { width: 16%; }
.report-data-table th:nth-child(4), .report-data-table td:nth-child(4) { width: 10%; }
.report-data-table th:nth-child(5), .report-data-table td:nth-child(5) { width: 30%; }
.report-data-table th:nth-child(6), .report-data-table td:nth-child(6) { width: 8%; }
.report-data-table th:nth-child(7), .report-data-table td:nth-child(7) { width: 10%; }
.report-data-table th:nth-child(8), .report-data-table td:nth-child(8) { width: 4%; }
.report-data-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-type-tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.report-type-tab {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-secondary);
  background: var(--color-surface);
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.report-type-tab.active {
  background: var(--color-primary);
  border-color: transparent;
  color: var(--color-text-inverse);
  box-shadow: 0 8px 18px rgba(var(--color-primary-rgb), 0.30);
}

.report-actions {
  display: flex;
  gap: var(--space-2);
}

.report-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.report-kpi-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 12px;
}

.report-kpi-card::before { display: none; }
.report-kpi-card .summary-value { font-size: 20px; margin-top: 2px; }
.report-kpi-card .summary-label { font-size: 10px; font-weight: 600; }

.report-kpi-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.report-kpi-icon.badge-info { color: var(--color-info); background: var(--color-info-soft); }
.report-kpi-icon.badge-success { color: var(--color-success); background: var(--color-success-soft); }
.report-kpi-icon.badge-primary { color: var(--color-primary); background: var(--color-primary-soft); }

.report-visual-grid {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(420px, 1.6fr);
  gap: 12px;
  margin-bottom: 12px;
}

.report-chart-card {
  min-height: 238px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-donut-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.report-donut {
  width: 122px;
  height: 122px;
  padding: 17px;
  border-radius: 50%;
}

.report-donut-center {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-border);
}

.report-donut-center span { color: var(--color-text-muted); font-size: 10px; }
.report-donut-center strong { font-size: 23px; line-height: 1.15; }

.report-chart-legend { display: grid; gap: 8px; }
.report-chart-legend > div {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  color: var(--color-text-secondary);
  font-size: 11px;
}
.report-chart-legend strong { color: var(--color-text-primary); }

.report-trend-bars {
  height: 178px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 14px 6px 0;
  border-bottom: 1px solid var(--color-border);
  background: repeating-linear-gradient(to top, transparent 0 43px, var(--color-border) 44px);
}

.report-trend-item {
  flex: 1;
  min-width: 18px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
}

.report-trend-bar {
  width: min(24px, 70%);
  min-height: 8px;
  border-radius: 4px 4px 1px 1px;
  background: linear-gradient(180deg, #6B6FF0, var(--color-primary));
  transition: height var(--transition-normal);
}

.report-trend-value,
.report-trend-label {
  color: var(--color-text-muted);
  font-size: 9px;
  white-space: nowrap;
}

.report-trend-value { color: var(--color-text-primary); font-weight: 650; }

.report-operational-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.report-operational-filters .form-select {
  width: auto;
  min-width: 170px;
}

.report-advanced-filters {
  margin: -8px 0 16px;
  padding: 0;
  overflow: hidden;
}

.report-advanced-filters > summary {
  padding: 12px 14px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 650;
  cursor: pointer;
  user-select: none;
}

.report-advanced-filters[open] > summary {
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
}

.report-advanced-filters .report-operational-filters {
  padding: 0 14px 14px;
}

.report-breakdown {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.report-breakdown-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(90px, 2fr) 32px;
  align-items: center;
  gap: 10px;
  font-size: var(--font-size-sm);
}

.report-breakdown-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-bg-subtle);
}

.report-breakdown-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary), #7866e6);
}

.report-breakdown-row strong {
  text-align: right;
}
