/* ============================================================
   premium-v2.css — Pochita Pay V2 (Cash App × Linear × Wise)
   STANDALONE — zero deps on solo-leveling.css / sl-system.css.
   Boss feedback 2026-05-18: V1 «хромает» (gaming cyan fought finance trust).
   ============================================================ */

:root {
  /* ─── SURFACES (cool greyscale, no hue cast) ─── */
  --bg-base:        #0a0a0c;
  --bg-card:        #101012;
  --bg-card-hover:  #16161a;
  --bg-elevated:    #1a1a1f;
  --bg-row-alt:     #0e0e11;
  --bg-input:       #16161a;

  /* ─── BORDERS ─── */
  --border:         rgba(255,255,255,0.06);
  --border-strong:  rgba(255,255,255,0.10);
  --border-focus:   #4d8eff;

  /* ─── TEXT (4 tiers, cool grey ladder) ─── */
  --text-primary:   #f5f5f7;
  --text-secondary: #a1a1aa;
  --text-muted:     #71717a;
  --text-dim:       #52525b;

  /* ─── SEMANTIC ACCENTS (financial only) ─── */
  --positive:       #16c784;
  --positive-bg:    rgba(22,199,132,0.10);
  --positive-soft:  rgba(22,199,132,0.06);
  --negative:       #ea3943;
  --negative-bg:    rgba(234,57,67,0.10);
  --negative-soft:  rgba(234,57,67,0.06);
  --accumulation:   #f0b90b;
  --accumulation-bg:rgba(240,185,11,0.10);
  --info:           #4d8eff;
  --info-bg:        rgba(77,142,255,0.10);
  --neutral:        #71717a;

  /* ─── SHADOWS (no glow, elevation only) ─── */
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.40);
  --shadow-card:  0 1px 3px rgba(0,0,0,0.30);
  --shadow-elev:  0 8px 24px rgba(0,0,0,0.50);
  --shadow-modal: 0 24px 60px rgba(0,0,0,0.65), 0 0 0 1px var(--border-strong);
  --focus-ring:   0 0 0 3px rgba(77,142,255,0.30);

  /* ─── RADII (smaller, sharper) ─── */
  --r-xs: 2px; --r-sm: 4px; --r-md: 6px; --r-lg: 10px; --r-xl: 14px;
  --r-full: 9999px;

  /* ─── SPACING (4pt grid) ─── */
  --s-1:4px;  --s-2:8px;  --s-3:12px; --s-4:16px;
  --s-5:20px; --s-6:24px; --s-8:32px; --s-10:40px;
  --s-12:48px; --s-16:64px;

  /* ─── MOTION (calm — no bounce) ─── */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 120ms; --dur-base: 180ms; --dur-slow: 250ms;

  /* ─── FONT FAMILIES ─── */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --num-tight: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
}

[data-theme="light"] {
  --bg-base:        #fafafa;
  --bg-card:        #ffffff;
  --bg-card-hover:  #f4f4f5;
  --bg-elevated:    #ffffff;
  --bg-row-alt:     #fafafa;
  --bg-input:       #f4f4f5;
  --border:         rgba(0,0,0,0.06);
  --border-strong:  rgba(0,0,0,0.10);
  --text-primary:   #18181b;
  --text-secondary: #52525b;
  --text-muted:     #71717a;
  --text-dim:       #a1a1aa;
  --positive:       #16a34a;
  --negative:       #dc2626;
  --accumulation:   #ca8a04;
}

/* ─── V1 expense-name compat layer — let pages with V1-token inline styles
       (login/pending) inherit V2 palette without rewriting selectors ─── */
:root {
  --surface-base:        var(--bg-base);
  --surface-card:        var(--bg-card);
  --surface-card-hover:  var(--bg-card-hover);
  --surface-elevated:    var(--bg-elevated);
  --surface-row-alt:     var(--bg-row-alt);
  --border-default:      var(--border);
  --money-positive:      var(--positive);
  --money-positive-bg:   var(--positive-bg);
  --money-negative:      var(--negative);
  --money-negative-bg:   var(--negative-bg);
  --money-accumulation:  var(--accumulation);
  --money-info:          var(--info);
  --money-info-bg:       var(--info-bg);
  --ease-base:           var(--ease-out);
}

/* ─── Reset + base ─── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Numerics — Tight axis ─── */
.num {
  font-family: var(--num-tight);
  font-variant-numeric: tabular-nums;
  font-variation-settings: 'wdth' 95;
  letter-spacing: -0.02em;
}
.num.pos   { color: var(--positive); }
.num.neg   { color: var(--negative); }
.num.acc   { color: var(--accumulation); }
.num.muted { color: var(--text-muted); }
.num-hero  { font-size: clamp(40px, 8vw, 56px); font-weight: 700; line-height: 1; }
.num-sm    { font-size: 12px; font-weight: 500; }

/* ─── Typography helpers ─── */
.label {
  font: 500 11px var(--font-sans);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--text-secondary);
}
h2.section { font: 600 20px var(--font-sans); margin: 0 0 var(--s-3); color: var(--text-primary); }
h3.card-title { font: 600 14px var(--font-sans); margin: 0 0 var(--s-2); color: var(--text-primary); }
.ts { font: 500 12px var(--font-sans); color: var(--text-muted); }

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-5);
  transition: background var(--dur-fast) var(--ease-out);
}
.card:hover { background: var(--bg-card-hover); }
.card-hero {
  padding: var(--s-6);
  border-radius: var(--r-xl);
  min-height: 200px;
}
.card-row {
  padding: var(--s-3) var(--s-4);
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
}
.card-row:last-child { border-bottom: 0; }
.card-row:hover { background: var(--bg-card-hover); cursor: pointer; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  min-height: 40px; padding: 0 14px;
  font: 500 14px var(--font-sans);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-primary  { background: var(--text-primary); color: var(--bg-base); }
.btn-primary:hover  { background: #ffffff; }
.btn-primary:active { transform: translateY(1px); }
.btn-positive { background: var(--positive); color: var(--bg-base); }
.btn-positive:hover { background: #14b377; }
.btn-negative { background: var(--negative); color: #fff; }
.btn-negative:hover { background: #d2333d; }
.btn-ghost    { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-strong); }
.btn-icon     { width: 36px; height: 36px; padding: 0; }
@media (pointer: coarse) { .btn { min-height: 44px; } }

/* ─── Inputs ─── */
.input {
  width: 100%; min-height: 40px; padding: 0 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font: 400 15px var(--font-sans);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.input:focus { border-color: var(--border-focus); box-shadow: var(--focus-ring); outline: none; }
.input::placeholder { color: var(--text-dim); }
.input-money {
  font-family: var(--num-tight);
  font-variant-numeric: tabular-nums;
  font-variation-settings: 'wdth' 95;
  text-align: right; letter-spacing: -0.02em;
}
@media (pointer: coarse) { .input { min-height: 44px; } }

/* ─── Chips ─── */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font: 500 11px var(--font-sans);
  border: 1px solid currentColor;
  background: transparent;
}
.chip-pos   { color: var(--positive); }
.chip-neg   { color: var(--negative); }
.chip-acc   { color: var(--accumulation); }
.chip-info  { color: var(--info); }
.chip-muted { color: var(--text-muted); }

/* ─── Topbar (slim, no sticky-glow) ─── */
.v2-topbar {
  display: flex; align-items: center; gap: var(--s-3);
  height: 48px;
  padding: 0 var(--s-4);
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.v2-topbar .brand {
  flex: 1;
  font: 600 15px var(--font-sans);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.v2-topbar-actions { display: flex; gap: var(--s-2); align-items: center; }

/* ─── Page wrap ─── */
.v2-page {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--s-5) var(--s-4) calc(72px + var(--s-5) + env(safe-area-inset-bottom));
  display: grid; gap: var(--s-5);
}
@media (min-width: 1024px) {
  .v2-page { max-width: 1080px; padding-bottom: var(--s-12); }
}

/* ─── Hero balance ─── */
.hero-balance .label { margin-bottom: var(--s-2); display: block; }
.hero-balance .num-hero { display: block; margin: 0; }
.hero-balance .currency {
  font: 500 16px var(--font-sans);
  color: var(--text-secondary);
  margin-top: 4px; display: inline-block;
}
.hero-balance .change-row {
  display: flex; align-items: center; gap: var(--s-2);
  margin-top: var(--s-3);
  font: 500 13px var(--font-sans);
}
.hero-balance .change-pos { color: var(--positive); }
.hero-balance .change-neg { color: var(--negative); }
.hero-balance .change-row .ts { color: var(--text-muted); }

/* ─── Sparkline ─── */
.sparkline {
  display: block;
  width: 100%; max-width: 320px; height: 32px;
  margin-top: var(--s-3);
}
.sparkline polyline { fill: none; stroke: var(--text-muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sparkline circle.pos { fill: var(--positive); }
.sparkline circle.neg { fill: var(--negative); }

/* ─── Hairline divider ─── */
.hairline { height: 1px; background: var(--border); border: 0; margin: 0; }

/* ─── Quick Actions (replaces V1 FAB) ─── */
.quick-actions {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s-2);
}
.qa-btn {
  min-height: 56px; padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font: 500 14px var(--font-sans);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.qa-btn:hover  { background: var(--bg-card-hover); border-color: var(--border-strong); }
.qa-btn:active { transform: translateY(1px); }
.qa-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.qa-btn--primary {
  background: var(--text-primary); color: var(--bg-base);
  border-color: var(--text-primary);
}
.qa-btn--primary:hover { background: #ffffff; }
.qa-btn svg { width: 20px; height: 20px; }
@media (pointer: coarse) { .qa-btn { min-height: 64px; } }

/* ─── Bottom-nav (5 items — V2 invariant) ─── */
.v2-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex;
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  z-index: 40;
}
.v2-bottom-nav .nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  text-decoration: none;
  font: 500 10px var(--font-sans);
  transition: color var(--dur-fast) var(--ease-out);
}
.v2-bottom-nav .nav-item:hover { color: var(--text-secondary); }
.v2-bottom-nav .nav-item.active { color: var(--text-primary); }
.v2-bottom-nav .nav-item svg { width: 22px; height: 22px; }

/* ─── Recent transactions list ─── */
.tx-list { display: flex; flex-direction: column; }
.tx-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.tx-row:last-child { border-bottom: 0; }
.tx-row:hover { background: var(--bg-card-hover); }
.tx-row .icon { font-size: 18px; line-height: 1; text-align: center; }
.tx-row .body { display: grid; gap: 2px; min-width: 0; }
.tx-row .body .ts { color: var(--text-muted); }
.tx-row .body .label-line { color: var(--text-primary); font: 500 14px var(--font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-row .amount { font-family: var(--num-tight); font-variant-numeric: tabular-nums; font-variation-settings: 'wdth' 95; letter-spacing: -0.02em; font-weight: 600; }

/* ─── Progress bar (thin 4px) ─── */
.progress {
  height: 4px;
  background: var(--bg-input);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress > .fill {
  height: 100%;
  background: var(--text-primary);
  transition: width var(--dur-slow) var(--ease-out);
}
.progress > .fill.pos { background: var(--positive); }
.progress > .fill.neg { background: var(--negative); }
.progress > .fill.acc { background: var(--accumulation); }

/* ─── Toast ─── */
.toast {
  position: fixed; top: var(--s-4); right: var(--s-4);
  max-width: 360px;
  padding: var(--s-3) var(--s-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--info);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-elev);
  opacity: 0; transform: translateY(-4px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  z-index: 60;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-positive { border-left-color: var(--positive); }
.toast.toast-negative { border-left-color: var(--negative); }
.toast.toast-warn     { border-left-color: var(--accumulation); }

/* ─── Reduced-motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    transform: none !important;
    scroll-behavior: auto !important;
  }
}
