/* ============================================================================
   BitVault — shared theme
   Single source of truth for design tokens, glassmorphism panels and the
   dark(=white text) / light(=black text) readability rules used app-wide.
   ============================================================================ */

/* ---------- App font: Space Grotesk (self-hosted; no external CDN so it works
   under the strict CSP and with no backend change). One variable file per
   subset covers every weight 300–700. ---------- */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --green: #0e9f6e;
  --blue: #2563eb;
  --amber: #f59e0b;
  --purple: #7c3aed;
  --bg: #0a0f19;
  --surf: rgba(18, 24, 36, 0.65);
  --text: #ffffff;
  --text-secondary: #9ca3af;
  --border: rgba(255, 255, 255, 0.05);
  --card-bg: rgba(18, 24, 36, 0.65);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.5);
  --pill-bg: #1e293b;
  --hover-glow: rgba(14, 159, 110, 0.28);
  --hover-border: rgba(14, 159, 110, 0.22);
  --input-bg: rgba(255, 255, 255, 0.05);
  --input-border: rgba(255, 255, 255, 0.12);
  --input-text: #ffffff;
  --input-placeholder: #94a3b8;
  --sidebar-bg: rgba(10, 15, 25, 0.9);
  --overlay: rgba(10, 15, 25, 0.78);
}

body.light {
  --bg: #f5f7fa;
  --surf: rgba(255, 255, 255, 0.85);
  --text: #1e293b;
  --text-secondary: #475569;
  --border: rgba(0, 0, 0, 0.08);
  --card-bg: rgba(255, 255, 255, 0.92);
  --card-border: rgba(0, 0, 0, 0.06);
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --pill-bg: #e2e8f0;
  --hover-glow: rgba(14, 159, 110, 0.3);
  --hover-border: rgba(14, 159, 110, 0.2);
  --input-bg: #ffffff;
  --input-border: rgba(0, 0, 0, 0.14);
  --input-text: #1e293b;
  --input-placeholder: #64748b;
  --sidebar-bg: rgba(255, 255, 255, 0.92);
  --overlay: rgba(226, 232, 240, 0.75);
}

*, *::before, *::after {
  transition: background-color 0.6s ease, color 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease;
}

html, body {
  font-family: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
body {
  background-color: var(--bg);
  color: var(--text);
}

/* ---------- Text wordmark (replaces the PNG so it renders in Space Grotesk) --
   "Bit" is brand green, "Vault" follows the theme text colour — matching the
   original two-tone logo, but as live text so it shares the app font. ------- */
.bv-wordmark {
  font-family: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-weight: 700; letter-spacing: -0.01em; line-height: 1; white-space: nowrap;
  display: inline-flex; align-items: baseline;
}
.bv-wordmark .wm-bit { color: var(--green); }
.bv-wordmark .wm-vault { color: var(--text); }

/* ---------- Readability: dark = white text, light = dark text ---------- */
body:not(.light) .text-gray-100,
body:not(.light) .text-gray-200,
body:not(.light) .text-gray-300 { color: #ffffff !important; }
body:not(.light) .text-gray-400 { color: #cbd5e1 !important; }
body:not(.light) .text-gray-500,
body:not(.light) .text-gray-600 { color: #94a3b8 !important; }

body.light .text-white { color: #1e293b !important; }
body.light .text-gray-100,
body.light .text-gray-200 { color: #1e293b !important; }
body.light .text-gray-300 { color: #334155 !important; }
body.light .text-gray-400 { color: #475569 !important; }
body.light .text-gray-500 { color: #64748b !important; }

/* Keep intentionally-white text white in light mode (e.g. on colour buttons). */
.btn-white-text,
.keep-white,
body.light .btn-white-text,
body.light .keep-white { color: #ffffff !important; }

/* Coloured accent text should stay legible in both themes (do not override). */
.text-emerald-300, .text-emerald-400, .text-emerald-500,
.text-red-300, .text-red-400, .text-amber-300, .text-amber-400,
.text-blue-300, .text-blue-400, .text-yellow-400 { }

/* ---------- Form controls ---------- */
input, textarea, select {
  color: var(--input-text);
}
input::placeholder, textarea::placeholder { color: var(--input-placeholder); opacity: 1; }

.bv-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--input-text);
  border-radius: 0.75rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.bv-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(14, 159, 110, 0.18);
}
.bv-label { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.35rem; display: block; }

/* Count bubble shared by the admin nav, the user sidebar nav, and the admin
   user-list / detail tabs. Context-specific tweaks (active colour, collapsed
   rail positioning) live with each sidebar. */
.bv-nav-badge { margin-left: auto; background: var(--green); color: #fff; font-size: 0.65rem; font-weight: 700;
  border-radius: 9999px; padding: 0.1rem 0.45rem; min-width: 1.25rem; text-align: center; line-height: 1.1rem; }

/* ---------- Sensitive fields: password / secret reveal toggle ---------- */
.pw-wrap { position: relative; }
.pw-wrap > .bv-input { padding-right: 2.8rem; }
.pw-toggle {
  position: absolute; right: 0.7rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--input-placeholder);
  font-size: 0.9rem; padding: 0.25rem; line-height: 1;
}
.pw-toggle:hover { color: var(--green); }

/* Masked monetary figures keep their box size stable when hidden. */
.bv-amount { font-variant-numeric: tabular-nums; }

/* Circular "hide balances" eye button in the top bar. */
.bv-eye-btn {
  width: 40px; height: 40px; border-radius: 9999px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--input-bg); border: 1px solid var(--card-border);
  color: var(--text-secondary); cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, color .2s ease;
}
.bv-eye-btn:hover { border-color: var(--green); color: var(--green); transform: translateY(-1px); }

/* Inline reveal eye for a single secret value (e.g. a displayed IBAN). */
.bv-reveal-btn { background: none; border: none; cursor: pointer; color: var(--input-placeholder); padding: 0.3rem 0.55rem; line-height: 1; }
.bv-reveal-btn:hover { color: var(--green); }

/* Native select/option colours per theme */
body:not(.light) select, body:not(.light) option { background-color: #1e293b; color: #ffffff; }
body.light select, body.light option { background-color: #ffffff; color: #1e293b; }

/* ---------- Cards / glass panels ---------- */
.card, .glass, .panel {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
}
.panel-hover { transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; }
.panel-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 60px -18px var(--hover-glow);
  border-color: var(--hover-border);
}

/* Shared circular asset mark (BV.assetLogo) — one look everywhere */
.bv-asset-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--card-border);
}

/* Segmented control (admin console: notice mode + priority). */
.bv-seg {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem;
  border-radius: 9999px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
}
.bv-seg button {
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.bv-seg button:hover { color: var(--text); }
.bv-seg button.active { background: var(--green); color: #fff; }

/* Admin-side preview of the notice card the user will actually see. */
.bv-notice-preview {
  border: 1px solid var(--card-border);
  border-radius: 0.9rem;
  padding: 0.9rem;
  text-align: center;
  background: var(--input-bg);
  transition: border-color 0.25s ease;
}

/* Priority pill on an admin-pushed dashboard notice (colour set inline). */
.bv-notice-prio {
  display: inline-block;
  margin-top: 0.55rem;
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* Portfolio allocation donut — soft depth + a gentle pop on paint */
@keyframes bv-donut-pop { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.bv-donut {
  transform-origin: center;
  animation: bv-donut-pop 0.55s var(--ease-premium, cubic-bezier(0.2, 0.8, 0.2, 1)) both;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.16));
}

/* ---------- Tasteful, ADDITIVE polish (React-Bits-inspired) ---------------
   Everything here is gated behind body.bv-fx, which app.js adds ONLY on a fine
   pointer with motion allowed. It never alters the existing glass surface
   (background / blur / border / shadow) — it only layers a pointer-follow glow
   BEHIND the card content (z-index:-1 within an isolated context) and a one-off
   entrance. Reduced-motion / touch users get the unchanged cards. */
.bv-fx .card,
.bv-fx .floating-panel,
.bv-fx .bv-modal { position: relative; isolation: isolate; }
/* Sidebar: only give it a positioned/isolated context at desktop widths, where it
   is an in-flow flex column. Below 768px layout.js turns it into a fixed off-canvas
   drawer — we must NOT override that position, so the glow is desktop-only. */
@media (min-width: 768px) { .bv-fx #bv-sidebar { position: relative; isolation: isolate; } }
.bv-fx .card::after,
.bv-fx .floating-panel::after,
.bv-fx .bv-modal::after,
.bv-fx #bv-sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;                 /* above the glass fill, below the content */
  opacity: 0;
  transition: opacity 0.4s ease;
  /* Greens only, on-brand — subtle. */
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, -30%),
              rgba(16, 185, 129, 0.10), rgba(14, 159, 110, 0.045) 45%, transparent 62%);
}
.bv-fx .card:hover::after,
.bv-fx .floating-panel:hover::after,
.bv-fx .bv-modal:hover::after,
.bv-fx #bv-sidebar:hover::after { opacity: 1; }
/* Belt-and-suspenders: no card glow on touch / no-hover devices (the JS gate on
   a fine pointer already prevents bv-fx there, this makes it explicit). */
@media (hover: none), (pointer: coarse) {
  .bv-fx .card::after,
  .bv-fx .floating-panel::after,
  .bv-fx .bv-modal::after,
  .bv-fx #bv-sidebar::after { display: none; }
}

/* One-time entrance for cards present at first paint. `both` fill guarantees the
   end (visible) state, so content can never be left hidden if anything hiccups. */
@keyframes bv-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.bv-fx .bv-reveal { animation: bv-rise 0.5s var(--ease-premium, cubic-bezier(0.2, 0.8, 0.2, 1)) both; }

/* ---------- Splash loader (shared: page-load, login→dashboard, logout) -------
   The WebGL hero drifts behind a large pulsing BitVault logo for ~1.8s. */
.bv-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
  transition: opacity 0.6s ease;
}
.bv-splash-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.bv-splash-logo {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  animation: bvSplashPulse 2s ease-in-out infinite;
}
/* Responsive so both the logo and wordmark scale down on phones without
   overflowing, and read large on desktop. */
.bv-splash-logo img { width: clamp(200px, 60vw, 380px); height: auto; filter: drop-shadow(0 10px 34px rgba(0, 0, 0, 0.4)); }
.bv-splash-logo .bv-wordmark { font-size: clamp(2.8rem, 13vw, 5rem); line-height: 1; }
@keyframes bvSplashPulse { 0%, 100% { transform: scale(1); opacity: 0.94; } 50% { transform: scale(1.05); opacity: 1; } }
.bv-splash.bv-splash-out { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .bv-splash-logo { animation: none; } }

/* Floating premium panel used for stat/holding tiles */
.floating-panel {
  background: var(--card-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: 1rem;
  position: relative;
  overflow: hidden;
}
.floating-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(16, 185, 129, 0.05), transparent);
  pointer-events: none;
}

/* ---------- Sidebar ---------- */
.sidebar-item {
  color: var(--text-secondary);
  transition: all 0.25s ease;
  border-left: 3px solid transparent;
  display: flex;
  align-items: center;
  padding: 0.7rem 1rem;
  border-radius: 0.75rem;
}
.sidebar-item:hover { color: #fff; background-color: rgba(30, 41, 59, 0.7); border-left-color: var(--green); }
.sidebar-item.active { background-color: var(--green); color: #fff; box-shadow: 0 8px 20px -6px rgba(14, 159, 110, 0.35); border-left-color: transparent; }
body.light .sidebar-item { color: #475569; }
body.light .sidebar-item:hover { color: #0f172a; background-color: rgba(226, 232, 240, 0.8); }
body.light .sidebar-item.active { color: #fff; }
.sidebar-item.text-red-400, .sidebar-item.text-red-400:hover,
body.light .sidebar-item.text-red-400 { color: #f87171 !important; }

/* Light mode only: nav icons render in brand green (Log Out stays red, and a
   selected item keeps its white icon on the green pill). Text is unaffected —
   only the icon glyph is tinted. */
body.light .sidebar-item:not(.active):not(.text-red-400) > i { color: var(--green); }
body.light .sidebar-item.active > i,
body.light .sidebar-item.text-red-400 > i { color: inherit; }
/* Light mode: the 3-line collapse / menu button also picks up brand green. */
body.light .bv-burger span { background: var(--green); }

/* ---------- Theme toggle pill ---------- */
/* Compact sun / moon pill. At rest each side shows only its icon; on a mouse
   hover the hovered side stretches open and the icon cross-fades to its
   "Dark" / "Light" label. Touch devices never hover, so they stay icon-only
   always — the toggle is never available on mobile. */
.theme-toggle {
  display: inline-flex;
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--pill-bg);
  cursor: pointer;
  user-select: none;
}
.theme-toggle span { position: relative; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; max-width: 2.4rem; padding: 6px 0.55rem; font-size: 0.75rem; font-weight: 600; line-height: 1; color: transparent; white-space: nowrap; overflow: hidden; transition: max-width .3s cubic-bezier(.22,1,.36,1), padding .3s cubic-bezier(.22,1,.36,1), color .18s ease, background .25s ease; }
.theme-toggle span.active { background: var(--green); }
.theme-toggle span::after { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 0.95rem; color: var(--text-secondary); opacity: 1; transition: opacity 0.2s ease; pointer-events: none; }
.theme-toggle span.active::after { color: #fff; }
.theme-toggle [id^="light-btn"]::after { content: "\f185"; }
.theme-toggle [id^="dark-btn"]::after { content: "\f186"; }
@media (hover: hover) and (pointer: fine) {
  .theme-toggle span:hover { max-width: 7rem; padding: 6px 0.95rem; color: var(--text-secondary); }
  .theme-toggle span.active:hover { color: #fff; }
  .theme-toggle span:hover::after { opacity: 0; }
}

/* ---------- Buttons ---------- */
.btn-primary {
  background: var(--green);
  color: #fff !important;
  border-radius: 9999px;
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 8px 20px -6px rgba(14, 159, 110, 0.4);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--input-border);
  border-radius: 9999px;
  padding: 0.6rem 1.3rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
/* Destructive/irreversible actions (reject, reset 2FA…) — outlined red. */
.btn-danger {
  background: transparent;
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.55);
  border-radius: 9999px;
  padding: 0.6rem 1.3rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform .18s var(--ease-premium, ease), background .2s ease, border-color .2s ease;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.1); border-color: #ef4444; transform: translateY(-1px); }
.btn-danger:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
body.light .btn-danger { color: #dc2626; border-color: rgba(220, 38, 38, 0.5); }

/* ---------- Modal / dialog ---------- */
.bv-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 1rem;
}
.bv-modal {
  background: var(--card-bg);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--card-border);
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6);
  border-radius: 1.25rem;
  width: 100%;
  color: var(--text);
  animation: bvModalIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes bvModalIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ---------- Status pills ---------- */
.status-pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.7rem; border-radius: 9999px; font-size: 0.72rem; font-weight: 600; }
.status-completed, .status-approved, .status-verified { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.status-processing, .status-pending, .status-submitted, .status-reviewed, .status-open { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.status-rejected, .status-denied, .status-failed, .status-suspended { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.status-info_requested, .status-closed { background: rgba(37, 99, 235, 0.15); color: #60a5fa; }
.status-not_started, .status-active { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

/* ---------- Animations ---------- */
@keyframes bvSpin { to { transform: rotate(360deg); } }
.bv-spin { animation: bvSpin 0.9s linear infinite; }
@keyframes bvPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.bv-pulse { animation: bvPulse 1.6s ease-in-out infinite; }
@keyframes bvPop { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
.bv-pop { animation: bvPop 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes bvFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.bv-fade-up { animation: bvFadeUp 0.4s ease forwards; }

/* Success checkmark stroke draw */
@keyframes bvDraw { to { stroke-dashoffset: 0; } }
.bv-check-circle { stroke-dasharray: 166; stroke-dashoffset: 166; animation: bvDraw 0.6s ease forwards; }
.bv-check-mark { stroke-dasharray: 48; stroke-dashoffset: 48; animation: bvDraw 0.35s 0.5s ease forwards; }

/* ---------- Transaction icon circle (directional colour set inline) ---------- */
.tx-ic { display: inline-flex; align-items: center; justify-content: center; border-radius: 9999px; flex-shrink: 0; font-size: 0.85rem; }

/* Sparkline / area-chart stroke draws in on open (uses pathLength="1"). */
.bv-spark-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: bvSparkDraw 0.9s var(--ease-premium, ease) forwards; }
@keyframes bvSparkDraw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .bv-spark-draw { animation: none; stroke-dashoffset: 0; } }

/* ---------- Animated status emblem (transaction detail) ---------- */
.bv-emblem { position: relative; width: 84px; height: 84px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.bv-emblem-svg { width: 84px; height: 84px; position: relative; z-index: 1; }
/* Soft coloured halo that eases outward once on open. */
.bv-emblem-halo { position: absolute; inset: 8px; border-radius: 9999px; background: radial-gradient(circle, var(--e) 0%, transparent 68%);
  opacity: 0.16; animation: bvEmblemHalo 0.9s var(--ease-premium, ease) forwards; }
@keyframes bvEmblemHalo { 0% { transform: scale(0.4); opacity: 0; } 60% { opacity: 0.24; } 100% { transform: scale(1); opacity: 0.16; } }
/* Pulsing ring for in-flight states (pending / info). */
.bv-emblem-pulse { animation: bvEmblemPulse 1.9s ease-in-out infinite; }
@keyframes bvEmblemPulse { 0%, 100% { transform: scale(0.9); opacity: 0.12; } 50% { transform: scale(1.08); opacity: 0.28; } }
/* Icon face (pending/info) inside a thin ring, popped in. */
.bv-emblem-face { position: relative; z-index: 1; width: 64px; height: 64px; border-radius: 9999px; display: flex; align-items: center;
  justify-content: center; font-size: 1.6rem; border: 2px solid; background: var(--card-bg); animation: bvPop 0.5s var(--ease-premium, ease) forwards; }
.bv-emblem-tick { animation: bvTick 2s steps(8) infinite; transform-origin: 50% 50%; }
@keyframes bvTick { to { transform: rotate(360deg); } }
/* Cross draw for declined states. */
.bv-cross { stroke-dasharray: 24; stroke-dashoffset: 24; animation: bvDraw 0.3s ease forwards; }
.bv-cross-1 { animation-delay: 0.45s; }
.bv-cross-2 { animation-delay: 0.62s; }
@media (prefers-reduced-motion: reduce) {
  .bv-emblem-halo, .bv-emblem-pulse, .bv-emblem-face, .bv-emblem-tick { animation: none !important; }
  .bv-check-circle, .bv-check-mark, .bv-cross { animation-duration: .001ms !important; stroke-dashoffset: 0 !important; }
}

/* Blurred KYC review overlay */
.kyc-blur { filter: blur(7px); pointer-events: none; user-select: none; }

/* Scrollbar polish */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.35); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.55); }

/* ============================================================================
   Premium refinements (v3.1) — smoother motion, richer depth, sharper type.
   Colours, glassmorphism and the design identity are unchanged; this only
   refines feel, spacing rhythm, micro-interactions and accessibility.
   ============================================================================ */
:root { --ease-premium: cubic-bezier(.22, 1, .36, 1); }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body { letter-spacing: -0.006em; }
h1, h2, h3, h4 { letter-spacing: -0.021em; }
h1, .text-4xl, .text-3xl { line-height: 1.12; }

/* Buttons — tactile, fluid feedback */
.btn-primary { transition: transform .18s var(--ease-premium), box-shadow .25s ease, opacity .2s ease, filter .2s ease; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -10px rgba(14, 159, 110, 0.5); filter: saturate(1.04); }
.btn-primary:active { transform: translateY(0) scale(0.985); box-shadow: 0 6px 16px -8px rgba(14, 159, 110, 0.5); }
.btn-ghost { transition: transform .18s var(--ease-premium), border-color .2s ease, background .2s ease; }
.btn-ghost:hover { transform: translateY(-1px); border-color: var(--green); }
.btn-ghost:active { transform: translateY(0) scale(0.985); }

/* Cards — richer layered depth + smoother lift (identity preserved) */
.card, .glass, .panel, .floating-panel {
  transition: box-shadow .35s var(--ease-premium), border-color .3s ease, transform .35s var(--ease-premium);
}
.panel-hover { transition: transform .35s var(--ease-premium), box-shadow .35s var(--ease-premium), border-color .3s ease; }
.panel-hover:hover { transform: translateY(-5px); }

/* Inputs — smoother focus settle */
.bv-input { transition: border-color .2s ease, box-shadow .25s var(--ease-premium), background .2s ease; }

/* Status pills — gentle fade between states */
.status-pill { transition: background .25s ease, color .25s ease; }

/* Modal — slightly longer, silkier entrance */
.bv-modal { animation: bvModalIn .34s var(--ease-premium); }

/* Keyboard-accessibility focus ring (on-brand, only for keyboard users) */
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }
input:focus-visible, textarea:focus-visible, select:focus-visible, .bv-input:focus-visible { outline: none; }

/* Respect users who prefer reduced motion (keep loaders meaningful) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .12s !important; scroll-behavior: auto !important;
  }
  .bv-spin, .bv-pulse { animation-duration: 1s !important; animation-iteration-count: infinite !important; }
}

/* ============================================================================
   Skeleton loaders — shown only while real data is in flight. A skeleton
   mirrors the layout of the content it stands in for (same paddings/heights)
   so nothing shifts when the data arrives. Shimmer is a soft highlight that
   sweeps across the base tone; under reduced motion it degrades to a static
   placeholder block.
   ============================================================================ */
:root {
  --skel-base: rgba(255, 255, 255, 0.055);
  --skel-hi: rgba(255, 255, 255, 0.115);
}
body.light {
  --skel-base: rgba(15, 23, 42, 0.07);
  --skel-hi: rgba(15, 23, 42, 0.125);
}

.bv-skel {
  position: relative;
  display: block;
  background: linear-gradient(100deg,
    var(--skel-base) 36%,
    var(--skel-hi) 50%,
    var(--skel-base) 64%);
  background-size: 220% 100%;
  border-radius: 0.5rem;
  animation: bvShimmer 1.7s ease-in-out infinite;
  /* Opt out of the global colour transition so the sweep stays crisp. */
  transition: none;
}
@keyframes bvShimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -100% 0; }
}
.bv-skel-circle { border-radius: 9999px; flex-shrink: 0; }
.bv-skel-pill { border-radius: 9999px; }

/* ============================================================================
   Transactions rows — aligned to the header on desktop (4/3/2/3), and a tidy
   two-row layout on phones so the amount never wraps mid-value and the status
   pill never crowds it. Driven by real CSS (not Tailwind utilities) so it
   works without recompiling the committed stylesheet.
   ============================================================================ */
.tx-row { display: grid; grid-template-columns: 4fr 3fr 2fr 3fr; gap: 0.5rem; align-items: center; }
.tx-row .txc-amt { text-align: right; white-space: nowrap; }
.tx-row .txc-ref { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 639px) {
  .tx-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "main amt" "ref status";
    column-gap: 0.75rem; row-gap: 0.5rem;
  }
  .tx-row .txc-main   { grid-area: main; }
  .tx-row .txc-amt    { grid-area: amt; }
  .tx-row .txc-ref    { grid-area: ref; align-self: center; }
  .tx-row .txc-status { grid-area: status; justify-self: end; }
}
