/* ── Compliance summary widgets ──────────────────────────────────────── */

#compliance-summary {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.comp-widget {
  flex: 1;
  min-width: 260px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.comp-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.comp-widget-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.range-btns { display: flex; gap: 2px; }

.range-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 0.7rem;
  padding: 1px 5px;
  border-radius: 3px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.range-btn:hover { color: var(--text); border-color: var(--border); }
.range-btn.active { color: var(--accent); border-color: var(--accent); background: rgba(79,140,255,0.1); }

.comp-widget-legend { display: flex; gap: 0.85rem; }

.cw-leg {
  font-size: 0.76rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.cw-leg::before {
  content: "";
  width: 12px;
  height: 2px;
  border-radius: 1px;
  display: inline-block;
}
.cw-leg.pass::before { background: #22c55e; }
.cw-leg.fail::before { background: #ef4444; }

.comp-chart-area { overflow: hidden; }

.sev-rows {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.sev-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sev-label {
  width: 54px;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 500;
}

.sev-spark {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 3px;
}

.sev-count {
  width: 28px;
  flex-shrink: 0;
  text-align: right;
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ── Inventory donut charts ──────────────────────────────────────────── */

#inv-charts {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.inv-chart-widget {
  flex: 1;
  min-width: 280px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.inv-chart-body {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.inv-donut-area { flex-shrink: 0; }

.inv-donut-legend {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.inv-leg-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
}

.inv-leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.inv-leg-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-leg-val {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.inv-leg-pct {
  font-variant-numeric: tabular-nums;
  min-width: 32px;
  text-align: right;
}

/* ── Chart tooltip ───────────────────────────────────────────────────── */

.chart-tooltip {
  position: fixed;
  z-index: 9999;
  background: #1a1d26;
  border: 1px solid #2a2f3a;
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  pointer-events: none;
  font-size: 0.78rem;
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  min-width: 120px;
}

.chart-tooltip .tt-date {
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 2px;
}

.chart-tooltip .tt-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  color: var(--text);
}
