/* Cost Tracking page — /costs */

/* ---- KPI strip ---- */
.ct-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 1400px) { .ct-kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .ct-kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.ct-kpi {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.ct-kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.ct-kpi-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}
.ct-kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- Live toggle ---- */
.ct-live-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
}
.ct-live-toggle input { display: none; }
.ct-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.2s;
}
.ct-live-dot.on {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-bg);
  animation: ct-pulse 2s infinite;
}
@keyframes ct-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ---- Trend chart ---- */
.ct-trend-card { margin-bottom: 20px; }
.ct-trend-chart { width: 100%; }
.ct-trend-chart svg { width: 100%; height: 140px; display: block; }
.ct-trend-bar { fill: var(--accent); opacity: 0.75; transition: opacity 0.1s; cursor: pointer; }
.ct-trend-bar:hover, .ct-trend-bar.hot { opacity: 1; }
.ct-trend-bar.zero { fill: var(--border); opacity: 0.6; }
.ct-trend-hover { font-size: 12px; color: var(--text-muted); min-height: 16px; }
.ct-trend-axis { font-size: 9px; fill: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* ---- Activity stream ---- */
.ct-activity-card { margin-bottom: 20px; }
.ct-activity-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.ct-activity-count { font-size: 11px; color: var(--text-muted); font-weight: 400; margin-left: 8px; }
.ct-activity-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.ct-select {
  background: var(--bg-card);
  color: var(--text-primary, inherit);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  padding: 5px 8px;
  max-width: 190px;
}
.ct-activity-body { max-height: 520px; overflow-y: auto; padding-top: 0; }
.ct-activity-table { width: 100%; }
.ct-activity-table thead th {
  position: sticky; top: 0;
  background: var(--bg-card);
  z-index: 1;
}
.ct-activity-table td { font-size: 12px; vertical-align: middle; }
.ct-activity-table .ct-num { text-align: right; }
.ct-row-new { animation: ct-flash 1.6s ease-out; }
@keyframes ct-flash {
  0% { background: var(--accent-bg); }
  100% { background: transparent; }
}
.ct-when { white-space: nowrap; }
.ct-when-rel { font-weight: 600; }
.ct-when-abs { font-size: 10px; color: var(--text-muted); }
.ct-cell-cost { font-family: 'JetBrains Mono', monospace; font-weight: 600; white-space: nowrap; }
.ct-cell-tokens { font-family: 'JetBrains Mono', monospace; color: var(--text-muted); white-space: nowrap; }
.ct-cell-cached { color: var(--success); }
.ct-endpoint-chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--accent-bg-subtle);
  border: 1px solid var(--border);
  font-size: 11px;
  white-space: nowrap;
}
.ct-svc-sub { display: block; font-size: 10px; color: var(--text-muted); margin-top: 1px; }

/* ---- Breakdown meter lists ---- */
.ct-breakdowns { margin-top: 20px; }
.ct-meter-list { display: flex; flex-direction: column; gap: 4px; }
.ct-meter-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  overflow: hidden;
}
.ct-meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent-bg-subtle);
  border-radius: 8px;
  z-index: 0;
}
.ct-meter-main { position: relative; z-index: 1; min-width: 0; }
.ct-meter-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-meter-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.ct-meter-right { position: relative; z-index: 1; text-align: right; flex-shrink: 0; }
.ct-meter-cost { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 13px; }
.ct-meter-pct { font-size: 11px; color: var(--text-muted); }

/* ---- Misc ---- */
.ct-empty { text-align: center; padding: 32px; color: var(--text-muted); font-size: 13px; }
.ct-muted { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.ct-pricing-group {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 6px 12px;
  background: var(--bg-tertiary);
}
