/* ============================================================================
   Vibe Dashboard v2 — Overview screen
   Ported from _specs/dashboard-v2-ref.vibe/Vibe Dashboard.dc.html
   (data-screen-label="Overview"). Consumes src/dashboard/overview.jsx +
   revenue-hero.jsx. Reads styles/v2-shell.css kit classes + vibe-tokens.css
   vars only — no hardcoded hex.
   ============================================================================ */

/* ---------- page header ---------- */
/* Mock tpl 156: the title block keeps 6px of its own below the column gap. */
.v2-ov-header { margin-bottom: 6px; }
.v2-ov-title { font-size: 30px; font-weight: 700; letter-spacing: -.6px; color: var(--v-text); }
.v2-ov-sub { font-size: 14.5px; color: var(--v-text-2); margin-top: 5px; }

/* ---------- revenue hero ---------- */
.v2-revhero { padding: 24px 26px; display: flex; flex-direction: column; gap: 14px; }

.v2-revhero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.v2-revhero-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--v-text-overline); }
.v2-revhero-share { font-size: 12px; color: var(--v-text-overline); margin-top: 2px; }
.v2-revhero-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: var(--v-r-pill);
  border: 1px solid var(--v-border-info);
  color: var(--v-text-2);
  font-size: 9.5px;
  font-weight: 700;
  cursor: help;
}
.v2-revhero-live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--v-text-2); }
.v2-revhero-live-dot { width: 6px; height: 6px; border-radius: var(--v-r-pill); background: var(--v-green); display: inline-block; }

/* VIB-471: the "Show estimates" button sits beside the blur pill (same row);
   wraps under it on narrow widths rather than forcing an overflow. */
.v2-revhero-pills { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.v2-btn-estimates { height: auto; padding: 5px 12px; font-size: 12px; }

/* The Odometer host's own class (rev-odometer, from revenue-hero.jsx) still
   carries dashboard.css's structural roll mechanics (reel/col overflow); these
   rules only override its v1 cosmetic skin (purple glow) with v2 tokens. */
.v2-revhero-value .rev-odometer {
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1;
  color: var(--v-text);
  text-shadow: none;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.v2-revhero-accrued {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--v-text-2);
}
.v2-revhero-accrued .rev-odometer.rev-odometer-acc {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--v-green);
  text-shadow: none;
  margin: 0;
}
.v2-revhero-estimate-link { color: var(--v-green); text-decoration: none; font-weight: 800; }
.v2-revhero-estimate-link:hover { color: var(--v-text); text-decoration: underline; }
/* mock dot-separator grey — no token; --v-text-3 at 50% over the card surface lands within 4/255 of it */
.v2-revhero-dot-sep { color: color-mix(in srgb, var(--v-text-3) 50%, var(--v-surface)); }

.v2-revhero-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 2px;
  padding-top: 15px;
  border-top: 1px solid var(--v-border-soft);
}
.v2-revhero-locked { font-size: 13px; color: var(--v-text-2); }
.v2-revhero-locked strong { color: var(--v-text); font-weight: 600; }
/* mock footer CTA: outlined text link at 8px 15px / 13.5px, not the 42px control */
.v2-revhero-foot .v2-btn-outline { height: auto; padding: 8px 15px; font-size: 13.5px; }

/* ---------- stat strip (Sep-2026 mock: A16 A17 A18 A20) ----------
   The kit's .v2-stat-grid / .v2-stat-card-label live in v2-shell.css (S1's
   file); the Overview strip overrides them under its own .v2-ov-stats hook:
   fixed 4 columns, 12.5px sentence-case labels, whole-cell hover tint. */
.v2-ov-stats { grid-template-columns: repeat(4, 1fr); }
.v2-ov-stats .v2-stat-card { transition: background .12s ease; }
.v2-ov-stats .v2-stat-card:hover { background: var(--v-hover-tint); }
.v2-ov-stats .v2-stat-card-label {
  font-family: var(--v-font);
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--v-text-2);
}
.v2-stat-card-dot { width: 7px; height: 7px; border-radius: var(--v-r-pill); background: var(--v-magenta); flex-shrink: 0; }
.v2-stat-card-value-sub { font-size: 14px; color: var(--v-text-2); font-weight: 400; }
.v2-stat-card-sub.is-done { display: inline-flex; align-items: center; gap: 5px; color: var(--v-text-2); }
.v2-stat-card-check { color: var(--v-green); flex-shrink: 0; }
/* Retired split-copy classes (P-OV-8: single desktop copy everywhere) — rule
   kept so the desktop base stays byte-identical. */
.v2-stat-mobile-copy, .v2-reflink-mobile-copy { display: none; }

/* ---------- referral link card ---------- */
.v2-reflink-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.v2-reflink-head { display: flex; flex-direction: column; gap: 3px; }
.v2-reflink-title { font-size: 13.5px; font-weight: 600; color: var(--v-text); }
.v2-reflink-sub { font-size: 12.5px; color: var(--v-text-2); }
.v2-reflink-row { display: flex; gap: 10px; align-items: stretch; }
.v2-reflink-box {
  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);
  /* mock: rgba(255,255,255,.08) inset-field border — one value on both screens */
  border: 1px solid var(--v-border-well);
  border-radius: var(--v-r-btn);
  padding: 0 14px;
  height: var(--v-btn-h);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- tasks / invites / ledger cards (extra data kept in-schema,
   not part of the v2 mock's Overview but real data this view already loads) ---------- */
.v2-invites-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.v2-invites-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.v2-req-pending { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--v-text-2); }
.v2-req-when { color: var(--v-text-3); }
.v2-req-err { margin-top: 6px; font-size: 12.5px; color: var(--v-rose); } /* L52: error line = danger rose (no user in src/ today) */
.v2-ledger-amount { color: var(--v-green); font-weight: 600; }
.v2-td-sub { color: var(--v-text-3); }
.v2-ledger-empty {
  padding: 28px 22px;
  text-align: center;
  font-size: 13.5px;
  color: var(--v-text-2);
}

/* ---------- mobile shell (≤900px) — Vibe App (Mobile) ----------
   Operator ruling "full mobile": every body block keeps its desktop mock
   metrics at 390px. This block only (a) pins type that must not shrink and
   (b) carries the overview-scoped overrides that win over the shell ≤900
   rules whichever slice lands first (H1). */
@media (max-width: 900px) {
  .v2-ov-header { order: -2; margin-bottom: 0; }
  /* L25: scoped to Overview — its head and notice slot are direct children
     of .v2-content. Other routes nest the slot in their page view and keep
     DOM order. */
  .v2-content[data-route="overview"] > .v2-notice-slot { order: -1; }
  /* P-OV-2: the mock keeps the 30px/700 title + 14.5px sub at 390. */
  .v2-ov-title { font-size: 30px; }
  .v2-ov-sub { margin-top: 5px; font-size: 14.5px; }
  /* P-OV-5: the revenue hero stays intact at 390 — desktop pad/gap/type,
     info dot, Updated line, dot separator and Trade CTA all render (no
     shrink rules here by design). */
  /* P-OV-6: app-only pills drop to their own right-aligned row under the
     14px label / Live-dot top row. */
  .v2-revhero-top { flex-wrap: wrap; }
  .v2-revhero-pills { flex: 1 1 100%; justify-content: flex-end; }
  /* P-OV-7: ONE bordered 2-col card — no gap, radius 12, cells pad 18/20
     gap 8, dividers on even cells + second row, 12.5px labels, 26px/600
     body-font values, 12px subs. Doubled class wins over the shell ≤900
     four-card rules (H1) whichever lands first. */
  .v2-stat-grid.v2-ov-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--v-border); background: var(--v-surface); border-radius: var(--v-r-card); overflow: hidden; }
  .v2-stat-grid.v2-ov-stats .v2-stat-card { border: 0; border-left: 1px solid var(--v-border-soft); border-radius: 0; background: transparent; padding: 18px 20px; gap: 8px; }
  .v2-stat-grid.v2-ov-stats .v2-stat-card:nth-child(odd) { border-left: none; }
  .v2-stat-grid.v2-ov-stats .v2-stat-card:nth-child(n + 3) { border-top: 1px solid var(--v-border-soft); }
  .v2-stat-grid.v2-ov-stats .v2-stat-card-label { font-size: 12.5px; }
  .v2-stat-grid.v2-ov-stats .v2-stat-card-value { font-family: var(--v-font); font-size: 26px; font-weight: 600; }
  .v2-stat-grid.v2-ov-stats .v2-stat-card-sub { font-size: 12px; }
  /* P-OV-8: one desktop copy at every width (mobile spans removed from
     overview.jsx); the done line stays grey with a green check via the
     base .is-done rule. */
  /* P-OV-9: the referral row stays horizontal — desktop pad 20/22, full
     sub, mono URL box + inline Copy (base rules already mock-exact). */
  /* P-OV-3: Points-eras card re-skin — 12.5px sentence-case labels so all
     card copy lands in the 12.5–13.5px band (radius/surface already mock
     via .v2-card). */
  .v2-ov-eras .v2-stat-card-label { font-family: var(--v-font); font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--v-text-2); }
}

/* ---- all-era points block (VIB-390) ---- */
.v2-ov-eras { padding: 0; }
.v2-ov-eras-link { font-size: 12.5px; color: var(--v-text-2); text-decoration: none; }
.v2-ov-eras-link:hover { color: var(--v-text); }
.v2-ov-era-grid {
  display: grid;
  /* auto-fit, not a fixed 4: an "Unknown era" row appears when the backend
     sends no era data, making it five. */
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-top: 1px solid var(--v-border-soft);
}
.v2-ov-era { padding: 16px 18px; display: flex; flex-direction: column; gap: 7px; }
.v2-ov-era + .v2-ov-era { border-left: 1px solid var(--v-border-soft); }
.v2-ov-era-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.7px;
  line-height: 1;
  color: var(--v-text);
  font-variant-numeric: tabular-nums;
}
.v2-ov-era.is-total .v2-ov-era-value { color: var(--v-green); }
.v2-ov-era-value.is-untracked { color: var(--v-text-2); font-size: 14px; font-weight: 500; }
.v2-ov-era-note {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--v-border-soft);
  font-size: 12.5px;
  color: var(--v-text-3);
}

@media (max-width: 720px) {
  .v2-ov-era-grid { grid-template-columns: 1fr 1fr; }
  .v2-ov-era + .v2-ov-era { border-left: none; }
  .v2-ov-era:nth-child(even) { border-left: 1px solid var(--v-border-soft); }
  .v2-ov-era:nth-child(n + 3) { border-top: 1px solid var(--v-border-soft); }
  .v2-ov-era-value { font-size: 21px; }
}

/* VIB-414 — non-final hero: the headline blurs harder at 64px so no digit
   shape survives; the accrued line uses the shared 5px blur. */
.v2-revhero-value .v2-blur-glyphs { font-size: 64px; font-weight: 700; letter-spacing: -2px; line-height: 1; filter: blur(14px); }
/* VIB-418: the locked hero for a non-superadmin — a lock glyph where the figure would be. */
.v2-revhero.is-locked .v2-revhero-lock { display: inline-flex; width: 56px; height: 56px; opacity: 0.6; }
.v2-revhero.is-locked .v2-revhero-lock svg { width: 100%; height: 100%; }
.v2-revhero-final-note { font-size: 12px; color: var(--v-text-overline); }
@media (max-width: 759px) {
  .v2-revhero-value .v2-blur-glyphs { font-size: 44px; letter-spacing: -1.5px; filter: blur(11px); }
}
