.history-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.filter-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-field label {
  font-size: 13px;
  color: #475569;
  white-space: nowrap;
}

.filter-field input[type='date'] {
  border: 1px solid var(--resource-border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  background: #ffffff;
  color: #1f2937;
}

.granularity-btns {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--resource-border);
  background: #f8fafc;
}

.granularity-btn {
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  font-size: 12px;
  padding: 6px 12px;
  cursor: pointer;
}

.granularity-btn.active {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
}

.checkbox-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--resource-border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  color: #334155;
  background: #f8fafc;
}

.checkbox-pill input[type='checkbox'] {
  margin: 0;
  width: 14px;
  height: 14px;
  accent-color: #2563eb;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 12px;
}

.chart-card {
  border: 1px solid var(--resource-border);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--resource-shadow);
  overflow: hidden;
}

.chart-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 12px 10px;
  border-bottom: 1px solid #eef2f7;
}

.chart-body {
  height: 320px;
}

.chart-no-data {
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.detail-toolbar {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.detail-name-cell {
  font-weight: 600;
}

.detail-cell {
  white-space: nowrap;
  font-size: 12px;
}

.query-error {
  margin-top: 4px;
}

@media (max-width: 1180px) {
  .chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .multi-select {
    min-width: 160px;
  }

  .filter-row {
    align-items: flex-start;
  }
}
