/* v2 dashboard is independent of v1 blocks; only financial dialogs are shared. */
html[data-cex-admin-template='v2'][theme='dark'] {
  --cv2-bg: #06111c;
  --cv2-panel: #0b1d27;
  --cv2-border: #1a3441;
  --cv2-text: #edf5fb;
  --cv2-muted: #7e9bb2;
  --cv2-accent: #09cec3;
  --cv2-tint: #0c3038;
}
html[data-cex-admin-template='v2'] .dashboard-page:has(.pv-dashboard) .topbar { display: none; }
.pv-dashboard { min-height: 100%; }
.pv-main { max-width: 1700px; margin: 0 auto; padding: 40px 38px 20px; display: grid; gap: 26px; min-width: 0; }
.pv-main * { box-sizing: border-box; }
.pv-main .cv2-button { font-size: 12px; padding: 10px 14px; border-radius: 7px; background: transparent; min-height: 38px; }
.pv-main .cv2-button .cv2-icon { width: 15px; height: 15px; }
.pv-main p { margin: 7px 0 0; line-height: 1.6; }
.pv-muted { color: var(--cv2-muted); font-size: 12px; }
.pv-kicker { color: var(--cv2-accent); font-size: 9px; font-weight: 650; letter-spacing: .14em; line-height: 1.6; }
.pv-hero { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding-bottom: 10px; }
.pv-hero h1 { font-size: clamp(25px, 2.1vw, 34px); letter-spacing: -.045em; line-height: 1.25; font-weight: 650; margin: 15px 0 12px; }
.pv-hero p { font-size: 13px; }
.pv-hero-actions { display: flex; gap: 10px; flex-shrink: 0; }
.pv-overview-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: -12px; }
.pv-overview-label > .pv-muted { font-size: 10px; }
.pv-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pv-panel { border: 1px solid var(--cv2-border); border-radius: 11px; padding: 24px; background: var(--cv2-panel); min-width: 0; overflow: hidden; }
.pv-metric { padding: 21px; position: relative; background-image: linear-gradient(115deg, transparent 55%, rgba(18,206,187,.065)); }
.pv-metric-0 { border-color: color-mix(in srgb, var(--cv2-accent) 35%, var(--cv2-border)); }
.pv-metric-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 34px; }
.pv-metric-heading > span:first-child { font-size: 9px; text-transform: uppercase; letter-spacing: .12em; color: var(--cv2-muted); }
.pv-metric-icon, .pv-bot-icon, .pv-banner-icon { display: grid; place-items: center; border: 1px solid var(--cv2-border); background: var(--cv2-tint); color: var(--cv2-accent); border-radius: 7px; width: 36px; height: 36px; flex: 0 0 auto; }
.pv-metric-2 .pv-metric-icon { color: #ab8cef; }
.pv-metric-3 .pv-metric-icon { color: #81afc3; }
.pv-metric-value { display: block; font-size: clamp(24px, 2.2vw, 34px); font-weight: 600; letter-spacing: -.04em; line-height: 1.35; margin: 12px 0; overflow-wrap: anywhere; }
.pv-metric-1 .pv-metric-value { color: var(--cv2-accent); }
.pv-metric > small { font-size: 10px; }
.pv-analysis { display: grid; grid-template-columns: minmax(0, 2.7fr) minmax(280px, 1fr); align-items: stretch; gap: 22px; }
.pv-insights { display: grid; gap: 18px; align-content: start; min-width: 0; }
.pv-insights-side { display: grid; gap: 18px; align-content: start; min-width: 0; }
.pv-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.pv-heading h2 { margin: 7px 0 0; font-size: 17px; font-weight: 600; letter-spacing: -.025em; }
.pv-heading p { font-size: 11px; }
.pv-performance { display: flex; flex-direction: column; }
.pv-performance .cv2-periods { flex: 0 0 auto; }
.pv-chart-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 30px 0 20px; }
.pv-chart-summary > strong { font-size: 26px; letter-spacing: -.035em; font-weight: 600; }
.pv-tag { display: inline-block; background: var(--cv2-tint); border: 1px solid var(--cv2-border); color: var(--cv2-accent); padding: 5px 9px; font-size: 10px; border-radius: 5px; }
.pv-performance-chart { width: 100%; min-height: 230px; flex: 1; color: var(--cv2-accent); overflow: visible; }
.pv-chart-point { fill: transparent; stroke: none; }
.pv-chart-point:only-of-type, .pv-chart-point:hover { fill: var(--cv2-accent); }
.pv-chart-dates { display: flex; justify-content: space-between; gap: 7px; color: var(--cv2-muted); font-size: 10px; padding-left: 8%; margin-top: 4px; }
.pv-chart-footnote { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 9px; color: var(--cv2-muted); margin-top: 24px; }
.pv-chart-footnote > span:first-child { color: var(--cv2-accent); }
.pv-chart-empty { flex: 1; display: flex; min-height: 290px; align-items: center; justify-content: center; gap: 15px; color: var(--cv2-muted); font-size: 13px; }
.pv-allocation { padding: 22px; }
.pv-allocation-main { display: flex; gap: 18px; align-items: center; margin: 25px 0 22px; }
.pv-donut { width: 125px; height: 125px; position: relative; flex: 0 0 auto; }
.pv-donut svg { width: 100%; height: 100%; }
.pv-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.pv-donut-center small { font-size: 9px; }
.pv-donut-center strong { font-size: 16px; letter-spacing: -.03em; }
.pv-legend { display: grid; flex: 1; min-width: 0; gap: 20px; }
.pv-asset { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.pv-asset i { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }
.pv-asset > span { min-width: 0; overflow-wrap: anywhere; }
.pv-asset small { display: block; font-size: 9px; margin-top: 4px; }
.pv-asset > strong { margin-left: auto; font-size: 11px; }
.pv-note { font-size: 9px; color: var(--cv2-muted); }
.pv-available { display: flex; justify-content: space-between; gap: 15px; margin: 20px -22px 0; padding: 17px 22px 4px; border-top: 1px solid var(--cv2-border); font-size: 12px; }
.pv-balance-actions { display: flex; justify-content: space-between; gap: 10px; padding-top: 8px; }
.pv-balance-actions .cv2-button { padding: 4px 0; border: none; min-height: 30px; font-size: 10px; color: var(--cv2-accent); }
.pv-connection { padding: 18px 22px; background-image: linear-gradient(120deg, rgba(0,199,190,.06), transparent); }
.pv-connection-top { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.pv-exchange-logo { display: grid; place-items: center; width: 38px; height: 38px; color: #5e8aff; background: rgba(84,131,239,.1); border: 1px solid var(--cv2-border); border-radius: 8px; font-weight: 700; font-size: 22px; }
.pv-connection-top small { display: block; font-size: 9px; margin-top: 5px; }
.pv-connection-top > .pv-status { margin-left: auto; }
.pv-connection-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 10px; }
.pv-connection-footer > span { font-size: 10px; }
.pv-connection-footer .cv2-button { border: none; color: var(--cv2-accent); padding: 0; min-height: 24px; font-size: 10px; }
.pv-status { display: inline-flex; align-items: center; white-space: nowrap; font-size: 10px; padding: 5px 8px; background: color-mix(in srgb, var(--cv2-muted) 8%, transparent); border: 1px solid var(--cv2-border); border-radius: 4px; color: var(--cv2-muted); }
.pv-status.is-good { color: var(--cv2-accent); background: var(--cv2-tint); }
.pv-bots .pv-heading .cv2-button, .pv-transactions .pv-heading .cv2-button { border: 0; color: var(--cv2-accent); }
.pv-bot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 25px; }
.pv-bot-card { border: 1px solid var(--cv2-border); border-radius: 9px; padding: 21px; min-width: 0; background-image: linear-gradient(120deg, rgba(7,202,180,.025), transparent); }
.pv-bot-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.pv-bot-card h3 { font-size: 14px; font-weight: 600; margin: 0; }
.pv-bot-card p { font-size: 10px; min-height: 30px; }
.pv-bot-profit { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 24px; }
.pv-bot-profit strong { display: block; font-size: 21px; font-weight: 600; margin-top: 5px; color: var(--cv2-accent); }
.pv-bot-profit small { font-size: 9px; }
.pv-sparkline { width: 100px; height: 35px; color: var(--cv2-accent); }
.pv-bot-1 :is(.pv-sparkline,.pv-bot-icon) { color: #a599ff; }
.pv-bot-2 :is(.pv-sparkline,.pv-bot-icon) { color: #7cc3f7; }
.pv-bot-action { border-top: 1px solid var(--cv2-border); margin-top: 24px; padding-top: 10px; }
.pv-bot-action .cv2-button { padding: 4px 0; width: 100%; border: none; justify-content: space-between; min-height: 30px; font-size: 11px; }
.pv-transactions { padding-bottom: 6px; }
.pv-table-scroll { overflow-x: auto; margin: 22px -24px 0; }
.pv-table { border-collapse: collapse; width: 100%; min-width: 700px; text-align: left; font-size: 11px; }
.pv-table th { color: var(--cv2-muted); font-weight: 400; padding: 10px 24px 16px; }
.pv-table td { padding: 23px 24px; border-top: 1px solid var(--cv2-border); white-space: nowrap; }
.pv-record-bot { display: inline-flex; align-items: center; gap: 12px; }
.pv-record-bot .cv2-icon { color: #dfaa6c; width: 22px; height: 22px; }
.pv-positive { color: var(--cv2-accent); }
.pv-negative { color: #ef6d86 !important; }
.pv-membership-banner { display: flex; align-items: center; gap: 18px; padding: 24px; border: 1px solid var(--cv2-border); border-radius: 10px; background: linear-gradient(110deg, var(--cv2-tint), var(--cv2-panel)); }
.pv-membership-banner > div { flex: 1; }
.pv-membership-banner strong { font-size: 13px; font-weight: 600; }
.pv-membership-banner p { font-size: 11px; }
.pv-banner-icon { width: 43px; height: 43px; }
.pv-membership-banner .cv2-button { flex: 0 0 auto; }
.pv-insights-side .pv-membership-banner { display: grid; grid-template-columns: 43px minmax(0, 1fr); align-items: start; gap: 12px; padding: 18px 22px; }
.pv-insights-side .pv-membership-banner > div { min-width: 0; }
.pv-insights-side .pv-membership-banner > .pv-tag { grid-column: 2; justify-self: start; }
.pv-insights-side .pv-membership-banner > .cv2-button { grid-column: 1 / -1; width: 100%; justify-content: center; }
@media (max-width: 1390px) {
  .pv-main { padding: 32px 26px; }
  .pv-analysis { grid-template-columns: minmax(0, 2fr) minmax(290px, 1fr); }
  .pv-allocation-main { gap: 10px; }
  .pv-donut { width: 110px; height: 110px; }
  .pv-donut-center strong { font-size: 14px; }
  .pv-hero { align-items: start; flex-direction: column; }
}
@media (max-width: 1100px) {
  .pv-analysis { grid-template-columns: minmax(0, 1fr); }
  .pv-insights { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
  .pv-bot-grid { gap: 14px; }
  .pv-bot-card { padding: 16px; }
  .pv-sparkline { width: 65px; }
}
@media (max-width: 767px) {
  /* Readable transaction text on phones; keep horizontal scrolling and the
   * positive/negative amount colors instead of overriding individual cells. */
  .pv-table { font-size: 14px; font-weight: 400; line-height: 1.5; color: var(--cv2-text); }
  .pv-table th { font-size: 13px; font-weight: 600; color: #566879; }
  .pv-table td { font-weight: 500; }
  html[data-cex-admin-template='v2'][theme='dark'] .pv-table th { color: #a5b8c9; }
  .pv-main { padding: 26px 16px; gap: 20px; }
  .pv-hero h1 { font-size: 27px; }
  .pv-hero-actions { flex-wrap: wrap; }
  .pv-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .pv-metric { padding: 16px; }
  .pv-metric-value { font-size: 23px; }
  .pv-metric-heading > span:first-child { font-size: 8px; }
  .pv-metric-icon { width: 28px; height: 28px; }
  .pv-panel:not(.pv-metric) { padding: 18px; }
  .pv-heading { flex-wrap: wrap; gap: 12px; }
  .pv-heading h2 { font-size: 17px; }
  .pv-chart-summary { margin: 20px 0 12px; }
  .pv-chart-summary > strong { font-size: 25px; }
  .pv-chart-dates { font-size: 8px; }
  .pv-chart-dates > span:nth-child(2n) { display: none; }
  .pv-chart-footnote { font-size: 8px; gap: 8px; }
  .pv-performance-chart { min-height: 180px; }
  .pv-insights, .pv-bot-grid { grid-template-columns: minmax(0, 1fr); }
  .pv-allocation-main { gap: 25px; }
  .pv-donut { width: 145px; height: 145px; }
  .pv-donut-center strong { font-size: 18px; }
  .pv-legend { gap: 22px; }
  .pv-asset { font-size: 12px; }
  .pv-bot-card { padding: 20px; }
  .pv-sparkline { width: 120px; }
  .pv-bot-profit { margin-top: 16px; }
  .pv-membership-banner { flex-wrap: wrap; padding: 20px; gap: 14px; }
  .pv-membership-banner > div { min-width: 190px; }
  .pv-insights-side .pv-membership-banner { padding: 18px; }
}
