/* ========================================================================
   Usage card — style B (".admin-usage-card")

   Single source of truth for the B-flavored usage card visuals. Loaded
   from both chat.html (sandbox test card #9) and admin.html (the
   per-user cards in the management view). Before this file existed,
   the same rules lived as a verbatim copy in both HTML files, which
   meant any tweak (bar height, font size, color) had to be done in
   two places — and once silently fell out of sync.

   Selector convention: every rule is rooted at ``.admin-usage-card``.
   The chat.html host adds ``.stat-card.usage-card`` siblings for the
   outer frame; admin.html nests the card inside ``.user-card``. Both
   work because every B-specific rule below is scoped to
   ``.admin-usage-card`` itself.

   Style A (``.usage-card`` without the ``admin-`` modifier) keeps its
   own rules inside chat.html and is untouched.
   ======================================================================== */

.admin-usage-card .uc-title {
  font-size: 11px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 800;
}
.admin-usage-card .uc-sub-meta {
  font-size: 9px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 3px;
}

.admin-usage-card .metric {
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 16px;
  margin-bottom: 14px;
  align-items: end;
}
.admin-usage-card .metric:last-of-type { margin-bottom: 0; }

.admin-usage-card .m-period-large {
  font-size: 14px;
  font-weight: 800;
  line-height: 3px;      /* match bar height so the label baseline sits at bar center */
  color: var(--text);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  padding-bottom: 0;
}

.admin-usage-card .m-body { min-width: 0; }

.admin-usage-card .metric-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 10px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 5px;
}

.admin-usage-card .m-sub-v {
  flex: 0 0 auto;
  color: var(--live);
  font-weight: 500;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.admin-usage-card .m-bonus-v {
  margin-left: auto;
  color: var(--phosphor);
  font-weight: 500;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.admin-usage-card .dual-bar {
  display: flex;
  width: 100%;
  height: 3px;
  background: transparent;
  overflow: visible;
  gap: 4px;
}
.admin-usage-card .dual-bar .seg {
  height: 100%;
  position: relative;
  outline: 1px solid var(--hair);
  overflow: hidden;
}
.admin-usage-card .dual-bar .seg-sub   { background: rgba(132, 204, 22, 0.28); }
.admin-usage-card .dual-bar .seg-bonus { background: rgba(245, 158, 11, 0.28); }
.admin-usage-card .dual-bar .fill { height: 100%; transition: width 0.4s; }
.admin-usage-card .dual-bar .seg-sub   .fill { background: var(--live);     box-shadow: 0 0 6px var(--live); }
.admin-usage-card .dual-bar .seg-bonus .fill { background: var(--phosphor); box-shadow: 0 0 6px var(--phosphor); }

/* 4th row — lifetime BONUS battery. Single phosphor bar, no sub side.
   Sits below the 3 cycle bars with a small gap so it reads as the
   "lifetime ledger" footer (vs the 5h/7d/28d meters above which reset).
   Label color forced phosphor so it stands out from 5H/7D/28D. */
.admin-usage-card .metric-lifetime { margin-top: 4px; }
.admin-usage-card .metric-lifetime .m-period-large { color: var(--phosphor); }
/* SONNET row label is longer than 5H/7D — shrink, tighten letter
   spacing, AND give it real line-height so the two-line wrap ("7D" /
   "SONNET") doesn't collide with itself (the base rule sets
   line-height: 3px to align a single-line label with the thin bar). */
.admin-usage-card .metric[data-w="7d_sonnet"] .m-period-large {
  font-size: 8px;
  letter-spacing: 0.04em;
  line-height: 1.15;
  align-self: center;
}
/* Bar row — wraps the dual-bar with the cycle-reset countdown so the
   badge sits next to the bar (vertically centered) instead of wrapping
   below it. Mirrors A card layout. The dual-bar inside .admin-usage-card
   has its own width:100% set above; we override here so flex sizing
   applies. */
.admin-usage-card .m-bar-row {
  display: flex; align-items: center; gap: 8px;
}
.admin-usage-card .m-bar-row .dual-bar {
  width: auto; flex: 1 1 auto; min-width: 0;
}
.admin-usage-card .cycle-reset {
  font-family: var(--font-mono); font-size: 8px;
  color: var(--text-mute); letter-spacing: 0.04em;
  white-space: nowrap;
  flex: 0 0 auto;
  min-width: 56px; text-align: right;
}
