/* ============================================================================
   Vibe Dashboard v2 — My code screen (L79: one name-code card)
   Ported from _specs/dashboard-v2-ref.vibe/Vibe Dashboard.dc.html
   (data-screen-label="My invites"). Builds on styles/v2-shell.css's shared kit
   (.v2-card/.v2-card-head/.v2-stat-grid/.v2-table/.v2-badge/.v2-pill/
   .v2-copy-row/.v2-empty/.v2-loading/.v2-error) — screen-specific bits only
   live here.
   ============================================================================ */

.v2-codes-view { display: flex; flex-direction: column; gap: 18px; }
/* Request button lives in the header flex row (mock M:1105) on every
   viewport (P-IN-1); the ≤900px block keeps the row, never bottom-mounts. */
.v2-codes-request-slot { flex-shrink: 0; }
.v2-codes-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.v2-codes-title { font-size: 30px; font-weight: 700; letter-spacing: -.6px; color: var(--v-heading); }
.v2-codes-subtitle { font-size: 14.5px; color: var(--v-text-2); margin-top: 5px; }

/* ---- request 5 more uses (top right of head) ---- */
.v2-codes-req { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.v2-codes-req-pending { font-size: 13.5px; color: var(--v-text-2); }
.v2-codes-req-err { font-size: 12px; color: var(--v-amber); }

.v2-codes-muted { color: var(--v-text-3); font-size: 13px; }
.v2-codes-mobile-copy { display: none; }

/* ---- referral-link copy card ---- */
.v2-codes-reflink { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.v2-codes-reflink-copy { display: flex; flex-direction: column; gap: 3px; }
.v2-codes-reflink-title { font-size: 13.5px; font-weight: 600; color: var(--v-text); }
.v2-codes-reflink-sub { font-size: 12.5px; color: var(--v-text-2); }
.v2-codes-reflink-row { gap: 10px; align-items: stretch; }
.v2-codes-reflink-value {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  font-family: var(--v-font-mono);
  font-size: 13px;
  color: var(--v-text-table);
  background: var(--v-inset);
  border: 1px solid var(--v-border-soft);
  border-radius: var(--v-r-btn);
  padding: 0 14px;
  height: var(--v-btn-h);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v2-codes-reflink-note { font-size: 12px; color: var(--v-text-3); line-height: 1.55; }

/* ---- the one code card: name code + copy + remaining uses ---- */
.v2-codes-code { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.v2-codes-code-copy { display: flex; flex-direction: column; gap: 3px; }
.v2-codes-code-title { font-size: 13.5px; font-weight: 600; color: var(--v-text); }
.v2-codes-code-sub { font-size: 12.5px; color: var(--v-text-2); line-height: 1.5; }
.v2-codes-code-row { gap: 10px; align-items: stretch; }
.v2-codes-code-value {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  font-family: var(--v-font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--v-text);
  background: var(--v-inset);
  border: 1px solid var(--v-border-soft);
  border-radius: var(--v-r-btn);
  padding: 0 14px;
  height: var(--v-btn-h);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v2-codes-uses { font-size: 13px; color: var(--v-text-2); font-variant-numeric: tabular-nums; }
.v2-codes-uses strong { color: var(--v-green); font-weight: 600; }

/* L92: "Your invite codes" — one row per minted single-use code (code,
   status badge, Copy on unused rows) and the invite-limit line. */
.v2-codes-invite-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.v2-codes-invite-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 40px;
  align-items: center;
  gap: 10px;
  background: var(--v-inset);
  border: 1px solid var(--v-border-soft);
  border-radius: var(--v-r-btn);
  padding: 8px 8px 8px 14px;
}
.v2-codes-invite-value {
  min-width: 0;
  font-family: var(--v-font-mono);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--v-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v2-codes-invite-row:not(.is-unused) .v2-codes-invite-value { color: var(--v-text-3); }
.v2-codes-invite-row.is-retired .v2-codes-invite-value { text-decoration: line-through; }
.v2-btn-outline.v2-btn-compact.v2-codes-invite-copy { width: 40px; height: 32px; padding: 0; justify-content: center; }
.v2-codes-invite-copy-gap { width: 40px; height: 32px; }
.v2-codes-limit { font-size: 13px; color: var(--v-text-2); font-variant-numeric: tabular-nums; }
.v2-codes-limit strong { color: var(--v-text); font-weight: 600; }

@media (max-width: 900px) {
  /* P-IN-1: the header keeps the desktop flex row so the request button stays
     inline right of the title (mock M:1100–1108). */
  .v2-codes-head { align-items: center; }
  /* The title block's long sub would otherwise push the button under it. */
  .v2-codes-head > div:first-child { flex: 1; min-width: 0; }
  /* P-IN-5: copy rows keep the side-by-side layout — value box beside Copy. */
  .v2-codes-reflink-row .v2-btn, .v2-codes-code-row .v2-btn { flex-shrink: 0; }
}
