/**
 * Analytics Center — scoped styles (Phase 8).
 */

.ax-root {
  display: flex;
  flex-direction: column;
  gap: var(--v2-space-5, 20px);
  max-width: 1600px;
}

.ax-eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--v2-color-primary, #1f6b4a);
}

.ax-health {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  align-items: flex-start;
}

.ax-health.tone-ok {
  border-color: color-mix(in srgb, #1f6b4a 40%, #e6ebe8);
}

.ax-health.tone-warn {
  border-color: color-mix(in srgb, #b8860b 45%, #e6ebe8);
}

.ax-health.tone-danger {
  border-color: color-mix(in srgb, #b33a3a 45%, #e6ebe8);
}

.ax-health-score {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
  margin: 6px 0;
}

.ax-health-unit {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary, var(--v2-text-secondary));
  margin-left: 4px;
}

.ax-health-parts {
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 220px;
}

.ax-health-parts li {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--v2-border, #e6ebe8);
  font-size: 13px;
}

.ax-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ax-module-chip {
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--v2-surface-muted, #f3f6f4);
  text-decoration: none;
  color: inherit;
  font-size: 12px;
}

.ax-module-chip.is-active {
  background: color-mix(in srgb, var(--v2-color-primary, #1f6b4a) 16%, white);
  outline: 1px solid var(--v2-color-primary, #1f6b4a);
}

.ax-metric-grid,
.ax-module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ax-metric,
.ax-module {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.ax-metric-label {
  font-size: 12px;
  color: var(--text-secondary, var(--v2-text-secondary));
}

.ax-metric-value {
  font-size: 22px;
  font-weight: 650;
}

.ax-metric-value.is-empty {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary, var(--v2-text-secondary));
}

.ax-section-title {
  margin: 0 0 12px;
  font-size: 16px;
}

.ax-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ax-chart {
  padding: 8px;
}

.ax-chart-title {
  margin: 0 0 10px;
  font-size: 14px;
}

.ax-chart-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
}

.ax-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ax-bar-row {
  display: grid;
  grid-template-columns: 96px 1fr 48px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.ax-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--v2-surface-muted, #eef2f0);
  overflow: hidden;
}

.ax-bar-fill {
  height: 100%;
  background: var(--v2-color-primary, #1f6b4a);
  border-radius: 999px;
}

.ax-bar-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ax-line-svg {
  width: 100%;
  height: auto;
  display: block;
}

.ax-line-path {
  stroke: var(--v2-color-primary, #1f6b4a);
  stroke-width: 2.5;
}

.ax-line-dot {
  fill: var(--v2-color-primary, #1f6b4a);
}

.ax-grid {
  stroke: #d7e0db;
  stroke-width: 1;
}

.ax-axis {
  fill: #5c6b64;
  font-size: 10px;
}

.ax-pie-body {
  display: flex;
  gap: 16px;
  align-items: center;
}

.ax-pie-svg {
  width: 160px;
  height: 160px;
  flex: 0 0 auto;
}

.ax-pie-hole {
  fill: var(--v2-surface, #fff);
}

.ax-pie-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
}

.ax-pie-legend li {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.ax-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.ax-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ax-list li {
  padding: 10px 12px;
  border-bottom: 1px solid var(--v2-border, #e6ebe8);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ax-list-card {
  padding: 0;
  overflow: hidden;
}

.ax-list-card .ax-chart-title {
  padding: 12px 12px 0;
}

.ax-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.ax-export-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ax-export-preview {
  max-height: 360px;
  overflow: auto;
  font-size: 11px;
}

.ax-tech pre {
  max-height: 320px;
  overflow: auto;
  font-size: 11px;
}

.ax-gap,
.ax-quick {
  margin-top: 4px;
}

.ax-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 1440px) {
  .ax-metric-grid,
  .ax-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1366px) {
  .ax-health,
  .ax-hero,
  .ax-two,
  .ax-pie-body {
    flex-direction: column;
  }
  .ax-two {
    grid-template-columns: 1fr;
  }
}
