/* =====================================================================
   Venice — Supply & Float
   Allium-native light chassis (design-system tokens) with Venice as the
   subject: Venice-blues chart palette, Venetian Blue as the one accent.
   Allium magenta is intentionally not used. Not co-branded.
   ===================================================================== */

:root {
  /* Venice palette (subject brand) */
  --deep-blue: #0E2942;
  --midnight-blue: #0A121A;
  --venetian: #3C8FDD;      /* the single interactive accent */
  --venetian-dark: #125DA3;
  --off-white: #F7F5ED;
  --sea-light: #B3D0EB;
  --mid-sea: #29526C;
  --stucco-mid: #BEA989;
  --neutral-gray: #6E7176;

  /* Override the Allium interactive accent with Venetian Blue (magenta dropped) */
  --primary: var(--venetian);
  --primary-foreground: #ffffff;
  --ring: var(--venetian);

  /* Page feel */
  --v-page-bg: #f7f8f9;
  --v-ink: var(--deep-blue);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-app-sans);
  color: var(--foreground);
  background: var(--v-page-bg);
  -webkit-font-smoothing: antialiased;
}

/* Deep-blue ink for headings (Venice-subject tone, still readable/neutral) */
h1, h2, h3, .h1, .h2, .h3 { color: var(--v-ink); }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.v-topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--border-muted);
}
.v-topbar-in {
  max-width: 1200px; margin: 0 auto; padding: 0 var(--spacing-lg);
  height: 56px; display: flex; align-items: center; gap: var(--spacing-lg);
}
.v-brand { display: flex; align-items: center; gap: var(--spacing-sm); text-decoration: none; }
.v-brand-keys { height: 22px; width: auto; }
.v-brand-word { font-size: 16px; font-weight: 700; color: var(--deep-blue); letter-spacing: -0.01em; }
.v-brand-tag { font-size: 13px; color: var(--muted-foreground); font-weight: 500; }
.v-nav { display: flex; gap: var(--spacing-md); margin-left: auto; }
.v-nav a {
  font-size: 13px; font-weight: 500; color: var(--muted-foreground);
  text-decoration: none; padding: 6px 4px; transition: color 120ms ease;
}
.v-nav a:hover { color: var(--venetian); }
.v-topbar-right { display: flex; align-items: center; gap: var(--spacing-sm); }
.v-asof { font-size: 11px; color: var(--muted-foreground); }
.v-topbar-div { width: 1px; height: 16px; background: var(--border-muted); }
.v-topbar-allium { height: 18px; width: auto; color: var(--deep-blue); display: block; }

/* ── Hero ────────────────────────────────────────────────────────────── */
.v-hero { border-bottom: 1px solid var(--border-muted); background: linear-gradient(180deg, #ffffff 0%, var(--v-page-bg) 100%); }
.v-hero-in { max-width: 1200px; margin: 0 auto; padding: var(--spacing-xl) var(--spacing-lg) var(--spacing-lg); position: relative; }
.v-hero-keys { height: 40px; width: auto; opacity: 0.9; margin-bottom: var(--spacing-md); }
.v-hero-title { font-size: 40px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.05; margin: 4px 0 12px; }
.v-hero-sub { max-width: 640px; color: var(--muted-foreground); margin: 0 0 var(--spacing-lg); }

/* KPI strip — standalone cards with gaps (7 metrics, so a partial last row is
   intentional-looking rather than a broken hairline grid). 4-across desktop. */
.v-kpi-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--spacing-sm);
}
.v-kpi {
  background: var(--card); border: 1px solid var(--border-muted);
  border-radius: var(--radius-card); box-shadow: var(--shadow-sm);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 3px;
  min-width: 0; /* let grid columns shrink below content width (no h-overflow on mobile) */
}
.v-kpi-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* subs may wrap (some are a full phrase) — grid stretches the row to match. */
/* Reserve two lines so values sit on a common baseline across a row even when
   a label wraps (e.g. "VVV as DIEM collateral"). */
.v-kpi-label { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted-foreground); min-height: 2.4em; line-height: 1.2; }
.v-kpi-value { font-family: var(--font-app-mono); font-size: 20px; font-weight: 600; color: var(--deep-blue); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.v-kpi-sub { font-size: 11px; color: var(--neutral-gray); font-variant-numeric: tabular-nums; }

/* ── Sections ────────────────────────────────────────────────────────── */
.v-section { max-width: 1200px; margin: 0 auto; padding: var(--spacing-lg) var(--spacing-lg); }
.v-band { margin-bottom: var(--spacing-md); padding-bottom: var(--spacing-sm); border-bottom: 2px solid var(--deep-blue); }
.v-band h2 { margin: 0 0 4px; }
.v-band-sub { margin: 0; color: var(--muted-foreground); max-width: 720px; }

.v-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--spacing-md); }
.v-col-2 { grid-column: span 2; }

/* ── Cards ───────────────────────────────────────────────────────────── */
.v-card {
  background: var(--card); border: 1px solid var(--border-muted);
  border-radius: var(--radius-card); box-shadow: var(--shadow-sm);
  padding: var(--spacing-md); overflow: hidden;
}
.v-card-h { margin-bottom: var(--spacing-sm); }
.v-card-h h3 { margin: 0 0 2px; }
.v-card-d { margin: 0; color: var(--muted-foreground); }
.v-chart { width: 100%; min-height: 260px; }
.v-chart-flex { width: 100%; }

/* legends */
.v-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.v-leg-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted-foreground); }
.v-leg-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.v-leg-line { width: 14px; height: 0; border-top: 2px solid; display: inline-block; }

/* ── SVG chart internals ─────────────────────────────────────────────── */
.vchart { display: block; overflow: visible; }
/* SVG gridlines (distinct from the .v-grid card layout grid above — this only
   ever applies to <line> elements inside a chart). */
.vchart .v-grid { stroke: var(--border-muted); stroke-width: 1; }
/* Axis tick labels. Kept pure black; the legibility lever at this size is
   weight + size, not color — 10px hairline mono grayscale-AAs to faint grey
   on macOS, so we render heavier and a touch larger. */
.v-axis { font-family: var(--font-app-mono); font-size: 11.5px; fill: #000000; font-weight: 600; }
.v-zero { stroke: var(--border); stroke-width: 1; }
.v-guide { stroke: var(--venetian); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.6; }

/* horizontal bars (categorical) */
.v-hbars { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.v-hbar-row { display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 12px; }
.v-hbar-label { font-size: 12px; color: var(--foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-hbar-track { background: var(--muted); border-radius: 3px; height: 18px; overflow: hidden; }
.v-hbar-fill { height: 100%; border-radius: 3px; transition: width 200ms ease; }
.v-hbar-val { font-family: var(--font-app-mono); font-size: 12px; color: var(--deep-blue); font-variant-numeric: tabular-nums; text-align: right; }
.v-hbar-sub { color: var(--neutral-gray); margin-left: 6px; font-size: 11px; }

/* tooltip */
.v-tooltip {
  position: fixed; z-index: 100; pointer-events: none;
  background: var(--deep-blue); color: var(--off-white);
  font-family: var(--font-app-sans); font-size: 12px; line-height: 1.5;
  padding: 8px 10px; border-radius: var(--radius); box-shadow: var(--shadow-md);
  max-width: 260px;
}
.v-tt-date { font-family: var(--font-app-mono); font-size: 11px; opacity: 0.8; margin-bottom: 4px; }
.v-tt-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.v-footer { border-top: 1px solid var(--border-muted); background: #fff; margin-top: var(--spacing-lg); }
.v-footer-in { max-width: 1200px; margin: 0 auto; padding: var(--spacing-lg); display: flex; flex-direction: column; gap: 10px; }
.v-footer-brand { display: flex; align-items: center; gap: 8px; color: var(--foreground); }
.v-footer-allium { height: 18px; width: auto; }
.v-footer-note { color: var(--muted-foreground); max-width: 900px; margin: 0; }

/* ── Loading ─────────────────────────────────────────────────────────── */
.v-loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--v-page-bg); z-index: 200; color: var(--muted-foreground); transition: opacity 200ms ease; }
.v-loading.hidden { opacity: 0; pointer-events: none; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .v-kpi-strip { grid-template-columns: repeat(3, 1fr); }
  .v-grid { grid-template-columns: 1fr; }
  .v-col-2 { grid-column: span 1; }
  .v-nav { display: none; }
  .v-hero-title { font-size: 30px; }
  .v-hero-in { padding-top: var(--spacing-lg); }
  .v-hbar-row { grid-template-columns: 110px 1fr auto; }
}
@media (max-width: 560px) {
  .v-kpi-strip { grid-template-columns: 1fr 1fr; }
  .v-section, .v-topbar-in, .v-hero-in, .v-footer-in { padding-left: var(--spacing-md); padding-right: var(--spacing-md); }
}
