/* SKU view — one row per SEGMENT-STATE-COVERAGE sku_code. Reuses the shared
   design tokens (var(--*)) so it matches the Campaigns/Sales grids. */

#sku-view .toolbar { flex-wrap: wrap; gap: 10px; align-items: flex-end; }

/* Grid CSV download — matches the leads/sales modal CSV buttons. */
#sku-csv-grid { gap: 6px; padding: 6px 10px; font-size: 12px; font-weight: 600; align-self: center; }
#sku-csv-grid[disabled] { opacity: .45; cursor: default; pointer-events: none; }

.sku-facet {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
}
.sku-facet select {
  min-width: 120px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
  font-size: 13px;
}

/* Distribution view — three columns of volume bars. */
.sku-dist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 10px 0 14px;
}
.sku-dist__col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.sku-dist__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 8px;
}
.sku-dist__row {
  display: grid;
  grid-template-columns: 96px 1fr 44px;
  align-items: center;
  gap: 8px;
  margin: 3px 0;
  font-size: 12px;
}
.sku-dist__k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
.sku-dist__bar { background: var(--surface-3); border-radius: 6px; height: 10px; overflow: hidden; }
.sku-dist__fill { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.sku-dist__v { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Grid */
.sku-table { width: 100%; border-collapse: collapse; }
.sku-table th, .sku-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.sku-table thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-weight: 600; cursor: pointer; user-select: none; white-space: nowrap; }
.sku-table th.col-left, .sku-table td.col-left { text-align: left; }
.sku-table td.tabnum, .sku-table th:not(.col-left) { text-align: right; font-variant-numeric: tabular-nums; }
.sku-table tbody tr.sku-row { cursor: pointer; }
.sku-table tbody tr.sku-row:hover { background: var(--surface-2); }
.sku-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; color: var(--fg-strong); }
.sku-badge { color: var(--amber); cursor: help; }

.sku-cov { max-width: 220px; }
.sku-tok {
  display: inline-block;
  padding: 1px 6px;
  margin: 1px 3px 1px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-3);
  font-size: 11px;
  color: var(--muted);
}

/* Trace status chips (live / paused / retired), reused in the drill-down. */
.sku-tr {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.sku-tr--live { color: var(--green); background: var(--green-soft); border-color: var(--green); }
.sku-tr--paused { color: var(--muted); background: var(--surface-3); border-color: var(--line); }
.sku-tr--retired { color: var(--amber); background: var(--amber-soft); border-color: var(--amber); }
.sku-tr-count { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--fg); margin-right: 4px; }

.sku-loading { padding: 20px; color: var(--muted); }

/* Drill-down modal body */
/* Widen ONLY the SKU drill-down modal (scoped to #sku-modal so the shared
   .modal-card--wide 640px rule is untouched for other modals) — gives the
   Companies table room so COMPANY ID + trailing columns aren't clipped.
   Stays responsive via the min() clamp so it never exceeds the viewport. */
#sku-modal .modal-card { max-width: min(1040px, 92vw); }
.sku-modal-body { max-height: 72vh; overflow: auto; }
.sku-sec { font-size: 13px; margin: 14px 0 6px; color: var(--fg-strong); }
.sku-sec .muted { font-weight: 400; font-size: 11px; }
