/* Sinapsi UI — shared charts (heatmap, donut, legend) */
.billing-hub-heatmap,
.ui-chart-heatmap {
  display: grid;
  gap: 16px;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.billing-hub-heatmap__viewport {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  container-type: inline-size;
  container-name: billing-hub-heatmap;
}

.billing-hub-heatmap__layout {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.billing-hub-heatmap__months,
.billing-hub-heatmap__grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: repeat(var(--billing-hub-heatmap-days), minmax(0, 1fr));
}

.billing-hub-heatmap__month {
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.billing-hub-heatmap__cell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

@container billing-hub-heatmap (max-width: 720px) {
  .billing-hub-heatmap__layout {
    --billing-hub-heatmap-gap: 1px;
    gap: 8px;
  }

  .billing-hub-heatmap__cell,
  .billing-hub-heatmap__cell-bar {
    border-radius: 4px;
  }
}

@container billing-hub-heatmap (max-width: 480px) {
  .billing-hub-heatmap__layout {
    --billing-hub-heatmap-gap: 0px;
    --billing-hub-heatmap-height: 92px;
    grid-template-rows: 12px var(--billing-hub-heatmap-height);
    gap: 6px;
  }

  .billing-hub-heatmap__month {
    font-size: 0.56rem;
    letter-spacing: 0;
  }

  .billing-hub-heatmap__cell,
  .billing-hub-heatmap__cell-bar {
    border-radius: 2px;
  }
}

@container billing-hub-heatmap (max-width: 360px) {
  .billing-hub-heatmap__layout {
    --billing-hub-heatmap-height: 84px;
  }

  .billing-hub-heatmap__month {
    font-size: 0.52rem;
  }
}

.spc-console-donut,
.ui-chart-donut {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.spc-console-donut__chart,
.ui-chart-donut__chart {
  position: relative;
  width: min(100%, 200px);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--theme-text) 4%, transparent);
}

.spc-console-donut__legend,
.ui-chart-donut__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  width: 100%;
}

.spc-console-legend-item,
.ui-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--theme-text-muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.spc-console-legend-item__dot,
.ui-chart-legend-item__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 10px;
}

/* Shared heatmap segment colors — use --chart-* tokens from tokens.css / themes.css */

.billing-hub-heatmap__segment--empty {
  background: var(--chart-color-empty);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--activated,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--activated,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--activated {
  background: var(--chart-billing-activated);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--renewal,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--renewal,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--renewal {
  background: var(--chart-billing-renewal);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--verification,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--verification,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--verification {
  background: var(--chart-billing-verification);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--refused-02,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--refused-02,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--refused-02 {
  background: var(--chart-billing-refused-02);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--refused-03,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--refused-03,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--refused-03 {
  background: var(--chart-billing-refused-03);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--refused-04,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--refused-04,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--refused-04 {
  background: var(--chart-billing-refused-04);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--refused-05,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--refused-05,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--refused-05 {
  background: var(--chart-billing-refused-05);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--refused-06,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--refused-06,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--refused-06 {
  background: var(--chart-billing-refused-06);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--refused-07,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--refused-07,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--refused-07 {
  background: var(--chart-billing-refused-07);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--deactivation,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--deactivation,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--deactivation {
  background: var(--chart-billing-deactivation);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--suspended,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--suspended,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--suspended {
  background: var(--chart-billing-suspended);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--neutral,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--neutral,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--neutral {
  background: var(--chart-billing-neutral);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--spc-wifi,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--spc-wifi,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--spc-wifi {
  background: var(--chart-netif-wifi);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--spc-usb,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--spc-usb,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--spc-usb {
  background: var(--chart-netif-usb);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--spc-unknown,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--spc-unknown,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--spc-unknown {
  background: var(--chart-netif-unknown);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--spc-online,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--spc-online,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--spc-online {
  background: var(--chart-connectivity-online);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--spc-offline,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--spc-offline,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--spc-offline {
  background: var(--chart-connectivity-offline);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--spc-with-account,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--spc-with-account,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--spc-with-account {
  background: var(--chart-spc-with-account);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--spc-without-account,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--spc-without-account,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--spc-without-account {
  background: var(--chart-spc-without-account);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--spc-paired-without-status,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--spc-paired-without-status,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--spc-paired-without-status {
  background: var(--chart-spc-paired-without-status);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--spc-provider-fastweb,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--spc-provider-fastweb,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--spc-provider-fastweb {
  background: var(--chart-provider-fastweb);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--spc-provider-vodafone,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--spc-provider-vodafone,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--spc-provider-vodafone {
  background: var(--chart-provider-vodafone);
}

.billing-hub-heatmap__cell-segment.billing-hub-heatmap__segment--spc-provider-other,
.billing-hub-heatmap__legend-swatch.billing-hub-heatmap__segment--spc-provider-other,
.billing-hub-heatmap-tooltip__status-dot.billing-hub-heatmap__segment--spc-provider-other {
  background: var(--chart-provider-other);
}
