/* styles.css — three dashboard variations, namespaced by class */

:root {
  --acc: #3b82f6;
  --acc-2: #2563eb;
}

* { box-sizing: border-box; }

/* ════════════════════════════════════════════════════════════════
   V2 — Bento Soft (Stripe / Vercel modern fintech)
   Soft gray bg, mixed card sizes, hero gradient card, plump radii
   ════════════════════════════════════════════════════════════════ */
.v2 {
  --bg: #f6f7f9;
  --bg-card: #ffffff;
  --bg-3: #eef0f3;
  --ink: #0b0d12;
  --ink-2: #3a4252;
  --ink-3: #6b7383;
  --ink-4: #a8aebd;
  --line: #e6e8ed;
  --line-2: #eef0f4;
  --acc: var(--acc, #3b82f6);
  --acc-2: #2563eb;
  --pos: #10a772;
  --neg: #e23a3a;
  --warn: #f59e0b;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100%;
  display: flex;
  font-size: 14px;
  letter-spacing: -0.003em;
}
.v2[data-mode="dark"] {
  --bg: #0c0e14;
  --bg-card: #161922;
  --bg-3: #1c2030;
  --ink: #f0f2f6;
  --ink-2: #c8ccd6;
  --ink-3: #8a92a4;
  --ink-4: #4f5564;
  --line: #242a3a;
  --line-2: #1a1f2c;
  --pos: #34d399;
  --neg: #f87171;
}

.v2 .sb {
  width: 240px;
  flex-shrink: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  transition: width 0.25s cubic-bezier(.16,1,.3,1);
}
.v2[data-collapsed="true"] .sb { width: 76px; }
.v2 .sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 22px;
  cursor: pointer;
}
.v2 .sb-logo {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--acc), var(--acc-2));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(59,130,246,0.30);
}
.v2 .sb-name { font-weight: 600; font-size: 15px; white-space: nowrap; letter-spacing: -0.015em; }
.v2[data-collapsed="true"] .sb-name,
.v2[data-collapsed="true"] .sb-caret,
.v2[data-collapsed="true"] .sb-section,
.v2[data-collapsed="true"] .sb-item-label,
.v2[data-collapsed="true"] .sb-acc-meta,
.v2[data-collapsed="true"] .sb-foot-label { display: none; }
.v2 .sb-section { font-size: 10.5px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.05em; padding: 16px 10px 6px; text-transform: uppercase; }
.v2 .sb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  margin-bottom: 2px;
}
.v2 .sb-item:hover { background: var(--bg-3); color: var(--ink); }
.v2 .sb-item.active {
  background: var(--bg-card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px var(--line);
}
.v2 .sb-item.active .sb-item-icon { color: var(--acc); }
.v2 .sb-item-icon { width: 18px; height: 18px; flex-shrink: 0; display: grid; place-items: center; color: var(--ink-3); }
.v2 .sb-item-label { flex: 1; white-space: nowrap; }
.v2 .sb-item-badge {
  background: var(--acc);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
}
.v2 .sb-spacer { flex: 1; }
.v2 .sb-foot {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.v2 .sb-acc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--bg-card);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.v2 .sb-acc-av {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--acc), #8b5cf6);
  color: white;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.v2 .sb-acc-name { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.v2 .sb-acc-id { font-size: 10.5px; color: var(--ink-3); font-family: ui-monospace,monospace; }

/* brand avatar (top-left) — matches the account avatar */
.v2 .sb-brand { display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 6px 8px 18px; }
.v2[data-collapsed="true"] .sb-brand { justify-content: center; }
.v2 .sb-brand-av {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--acc), #8b5cf6);
  color: #fff; font-size: 13px; font-weight: 700;
  border: 0; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(59,130,246,0.30);
  flex-shrink: 0;
}
.v2 .sb-brand-av:hover { filter: brightness(1.05); }

/* nested account groups */
.v2 .sb-group { display: flex; flex-direction: column; }
.v2 .sb-group-head .sb-caret { margin-left: auto; color: var(--ink-4); display: grid; place-items: center; transition: transform 0.2s ease; }
.v2 .sb-group-head .sb-caret.open { transform: rotate(90deg); }
.v2 .sb-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 6px; padding-left: 30px; position: relative; }
.v2 .sb-sub::before { content: ""; position: absolute; left: 18px; top: 4px; bottom: 6px; width: 1.5px; background: var(--line); border-radius: 1px; }
.v2 .sb-subitem {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 9px;
  border: 0; background: transparent; cursor: pointer;
  color: var(--ink-3); font-size: 13px; font-weight: 500;
  width: 100%; text-align: left;
}
.v2 .sb-subitem:hover { background: var(--bg-3); color: var(--ink); }
.v2 .sb-subitem.active {
  background: var(--bg-card); color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px var(--line);
}
.v2 .sb-subitem-label { flex: 1; white-space: nowrap; }

.v2 .main { flex: 1; min-width: 0; overflow: auto; padding: 16px 20px 16px 4px; }
.v2 .main-card {
  background: var(--bg-card);
  border-radius: 18px;
  border: 1px solid var(--line);
  overflow: hidden;
  min-height: calc(100% - 0px);
}
.v2 .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 152px 18px 28px;
  border-bottom: 1px solid var(--line);
}
.v2 .topbar-l h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
}
.v2 .topbar-l .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.v2 .topbar-r { display: flex; align-items: center; gap: 8px; }
.v2 .icon-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.v2 .icon-btn:hover { background: var(--bg-3); }
.v2 .btn {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  font-weight: 500;
}
.v2 .btn-prim {
  background: var(--ink);
  color: var(--bg-card);
  border-color: var(--ink);
}

.v2 .content { padding: 22px 28px 32px; display: grid; gap: 14px; }

.v2 .bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.v2 .b-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}
.v2 .b-card.hero {
  background: linear-gradient(135deg, #4a7fd0 0%, #2f5fc4 50%, #1c8f66 100%);
  color: white;
  border: 0;
  position: relative;
  overflow: hidden;
}
.v2 .b-card.hero::before {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 70%);
  pointer-events: none;
}
.v2 .b-card.hero::after {
  content: "";
  position: absolute;
  bottom: -60px; left: 30%;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255,255,255,0.10), transparent 70%);
  pointer-events: none;
}
.v2 .span-12 { grid-column: span 12; }
.v2 .span-8 { grid-column: span 8; }
.v2 .span-7 { grid-column: span 7; }
.v2 .span-6 { grid-column: span 6; }
.v2 .span-5 { grid-column: span 5; }
.v2 .span-4 { grid-column: span 4; }
.v2 .span-3 { grid-column: span 3; }

.v2 .hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 1;
}
.v2 .hero-eyebrow { font-size: 11.5px; font-weight: 500; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.06em; }
.v2 .hero-val {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.v2 .hero-delta { font-size: 13.5px; margin-top: 8px; opacity: 0.95; font-variant-numeric: tabular-nums; }
.v2 .hero-delta b { font-weight: 600; }
.v2 .hero-stats {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 16px 28px;
  font-variant-numeric: tabular-nums;
}
.v2 .hero-stats .lbl { font-size: 11px; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.05em; }
.v2 .hero-stats .val { font-size: 18px; font-weight: 600; margin-top: 2px; }

.v2 .b-eye { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.v2 .b-val {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.022em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.v2 .b-delta { font-size: 12px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.v2 .pos { color: var(--pos); }
.v2 .neg { color: var(--neg); }

.v2 .b-h {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
}
.v2 .b-title { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.v2 .b-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

.v2 .seg {
  display: inline-flex;
  background: var(--bg-3);
  border-radius: 999px;
  padding: 3px;
}
.v2 .seg-btn {
  padding: 5px 12px;
  font-size: 11.5px;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
}
.v2 .seg-btn.active { background: var(--bg-card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.v2 .obj-list { display: flex; flex-direction: column; gap: 16px; }
.v2 .obj-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.v2 .obj-name { font-size: 13px; font-weight: 500; }
.v2 .obj-stat { font-family: ui-monospace,monospace; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; }
.v2 .obj-bar {
  height: 8px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
}
.v2 .obj-fill { height: 100%; background: var(--acc); border-radius: 999px; transition: width 0.5s cubic-bezier(.16,1,.3,1); }
.v2 .obj-fill.warn { background: var(--warn); }
.v2 .obj-fill.neg { background: var(--neg); }
.v2 .obj-fill.pos { background: var(--pos); }
.v2 .obj-meta { font-size: 11px; color: var(--ink-3); margin-top: 4px; font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; }

.v2 .pos-list { display: flex; flex-direction: column; gap: 10px; }
.v2 .pos-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-3);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}
.v2 .pos-sym-side { display: flex; align-items: center; gap: 8px; }
.v2 .pos-sym { font-weight: 700; font-family: ui-monospace,monospace; font-size: 13px; }
.v2 .pos-side {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; padding: 2px 6px; border-radius: 4px;
}
.v2 .pos-side.buy { background: rgba(16,167,114,0.15); color: var(--pos); }
.v2 .pos-side.sell { background: rgba(226,58,58,0.15); color: var(--neg); }
.v2 .pos-meta { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.v2 .pos-pnl { font-family: ui-monospace,monospace; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; }

.v2 .perf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.v2 .perf-cell {
  padding: 14px;
  background: var(--bg-3);
  border-radius: 12px;
}
.v2 .perf-lbl { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.v2 .perf-val { font-size: 19px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.v2 .perf-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; font-variant-numeric: tabular-nums; }

.v2 table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.v2 thead th {
  text-align: left; font-weight: 600; font-size: 10.5px; color: var(--ink-3);
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.v2 tbody td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
.v2 tbody tr:hover td { background: var(--bg-3); }

.v2 .sym-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.v2 .sym-card {
  padding: 14px; border-radius: 12px; background: var(--bg-3);
}
.v2 .sym-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.v2 .sym-name { font-family: ui-monospace,monospace; font-weight: 700; font-size: 13px; }
.v2 .sym-pnl { font-family: ui-monospace,monospace; font-weight: 600; font-variant-numeric: tabular-nums; }
.v2 .sym-meta { font-size: 11px; color: var(--ink-3); margin-bottom: 8px; font-variant-numeric: tabular-nums; }


/* shared dark/light toggle look used in all variations */
.theme-toggle {
  display: inline-flex;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 0;
}
.theme-toggle button {
  min-width: 30px; height: 30px;
  padding: 0 9px;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
}
.theme-toggle button.active {
  background: var(--bg-card);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}


/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — mobile adaptation (off-canvas drawer + 1-col bento)
   Added 2026-06-03. Targets the active .v2 layout only.
   ════════════════════════════════════════════════════════════════ */

/* hamburger + scrim are desktop-hidden; theme toggle lives in the
   right gutter created by .page-wrap padding (desktop). */
.v2 .mobnav-toggle { display: none; }
.v2 .mob-scrim { display: none; }
.v2 .page-wrap { padding-right: 90px; }
.v2 .theme-toggle-pos { position: absolute; top: 22px; right: 28px; z-index: 5; }

@media (max-width: 860px) {
  /* shell: stack, sidebar becomes an off-canvas drawer */
  .v2 { display: block; min-height: 100dvh; }

  .v2 .sb {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px !important;
    background: var(--bg-card);
    border-right: 1px solid var(--line);
    box-shadow: 0 0 40px rgba(0,0,0,0.28);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(.16,1,.3,1);
    overflow-y: auto;
    padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
  }
  .v2[data-mobnav="open"] .sb { transform: translateX(0); }

  .v2 .mob-scrim {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
  }
  .v2[data-mobnav="open"] .mob-scrim { opacity: 1; pointer-events: auto; }

  /* hamburger — fixed top-left, ≥44px touch target */
  .v2 .mobnav-toggle {
    display: grid; place-items: center;
    position: fixed; top: 12px; left: 12px;
    width: 44px; height: 44px;
    z-index: 60;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--ink);
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    cursor: pointer;
  }

  /* main column → full width, flush edges */
  .v2 .main { padding: 0; overflow: visible; }
  .v2 .main-card { border-radius: 0; border-left: 0; border-right: 0; min-height: 100dvh; }

  /* topbar clears hamburger (left) and theme toggle (right) */
  .v2 .topbar { padding: 16px 84px 14px 64px; }
  .v2 .topbar-l h1 { font-size: 19px; }
  .v2 .page-wrap { padding-right: 0; }
  .v2 .theme-toggle-pos { top: 14px; right: 12px; }
  .v2 .tt-label { display: none; }

  /* content + bento collapse to a single column */
  .v2 .content { padding: 16px 14px calc(28px + env(safe-area-inset-bottom)); }
  .v2 .bento { grid-template-columns: 1fr; gap: 12px; }
  .v2 .bento > [class*="span-"] { grid-column: 1 / -1 !important; }

  /* wide tables scroll horizontally instead of clipping */
  .v2 .b-card table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* touch targets ≥44px */
  .v2 .icon-btn { width: 44px; height: 44px; }
  .v2 .sb-item, .v2 .sb-subitem { min-height: 44px; }
  .v2 .seg-btn { padding: 8px 12px; }

  /* hero scales down */
  .v2 .hero-val { font-size: 36px; }
  .v2 .hero-row { gap: 16px; }
}

@media (max-width: 520px) {
  .v2 .hero-val { font-size: 30px; }
  .v2 .hero-row { flex-direction: column; align-items: flex-start; }
  .v2 .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .v2 .perf-grid { grid-template-columns: repeat(2, 1fr); }
  .v2 .topbar-l .sub { font-size: 11.5px; }
}

/* honor the OS "reduce motion" setting */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
