#statistics { --stats-surface: linear-gradient(120deg, #16281ed0, #102118d0); --stats-border: #a7bfad2e; color: #e3e8e2; }
#statistics .api-page-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; margin-bottom: 36px; }
body.dashboard-wallpaper #statistics .api-page-heading h2 {
  display: inline-block; margin: 0; font: 400 clamp(48px, 6.5vw, 88px)/1.08 'Times New Roman', Times, serif; letter-spacing: -2px;
  background: linear-gradient(110deg, #fff 5%, #fff 25%, #edcea2 45%, #ffe3bc 60%, #fff 85%); background-size: 260% 100%;
  background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: analysis-title-shimmer 7s ease-in-out infinite alternate;
}
#statistics .api-preset-picker { padding: 14px 20px; gap: 14px; border: 1px solid var(--stats-border); background: var(--stats-surface); color: #e3e8e2; max-width: 360px; }
#statistics .api-preset-picker > svg { width: 22px; height: 22px; color: #fbd9b0; flex-shrink: 0; }
#statistics .api-preset-picker .glass-select { flex: 1; width: auto; min-width: 0; }
#statistics .api-preset-picker .glass-select-trigger { min-height: 24px; padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; color: #e3e8e2; font-size: 14px; font-weight: 400; }
#statistics .api-preset-picker .glass-select-trigger:hover { color: #fbd9b0; }
#statistics :is(.stat-card, .panel-box, .chart-container-box) { border: 1px solid var(--stats-border); border-radius: 24px; background: var(--stats-surface); box-shadow: inset 0 1px 0 #ffffff05; color: #e3e8e2; backdrop-filter: blur(12px); }
#statistics .stats-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
#statistics .stat-card { padding: 22px 18px; min-width: 0; transition: transform .2s ease, border-color .2s ease; }
#statistics .stat-card:hover { transform: translateY(-2px); border-color: #fbd9b080; box-shadow: inset 0 1px 0 #fff0dc12; }
#statistics .stats-metric-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 16px; border: 1px solid #fbd9b021; border-radius: 14px; background: #ffffff03; color: #fbd9b0; }
#statistics .stats-metric-icon svg { width: 26px; height: 26px; }
#statistics .stat-card h3 { color: #aeb8b2; min-height: 3.9em; margin: 0 0 12px; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; line-height: 1.3; }
#statistics .stat-card .stat-value { color: #edf0eb; font-size: clamp(20px, 2vw, 28px); font-weight: 400; overflow-wrap: anywhere; }
#statistics .pnl-positive { color: #00d8a0 !important; }
#statistics .pnl-negative { color: #ff575d !important; }
#statistics .allocation-positions-container { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.6fr); gap: 20px; margin-bottom: 24px; }
#statistics :is(.allocation-panel, .positions-panel) { min-width: 0; padding: 24px; }
#statistics :is(.panel-title, .chart-header h3) { color: #e3e8e2; font-size: 21px; font-weight: 400; text-transform: none; letter-spacing: -.3px; line-height: 1.4; }
#statistics .table-wrapper { border: 1px solid #a7bfad1f; border-radius: 16px; overflow-x: auto; background: transparent; box-shadow: none; }
#statistics .trades-table { margin: 0; min-width: 650px; background: transparent; border-collapse: collapse; }
#statistics .trades-table thead { background: linear-gradient(120deg, #ffe5c4e0, #f4cea0d6); }
#statistics .trades-table th { padding: 14px 12px; background: transparent; color: #152017; font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; }
#statistics .trades-table td { padding: 16px 12px; color: #e3e8e2; font-size: 13px; border-bottom: 1px solid #ffffff08; white-space: nowrap; }
#statistics .trades-table tbody tr:hover { background: #fbd9b008; }
#statistics .side-buy { background: #00795330; color: #00d8a0; border: 1px solid #00d8a01a; }
#statistics .side-sell { background: #8f292930; color: #ff6b60; border: 1px solid #ff6b601a; }
#statistics .badge { border-radius: 12px; padding: 6px 10px; font-weight: 400; }
#statistics :is(.empty-message, .empty-cell, .muted-text, .allocation-percent) { color: #aeb8b2; }
#statistics .allocation-row { gap: 12px; color: #e3e8e2; flex-wrap: wrap; }
#statistics .allocation-bar { background: #ffffff07; border: 1px solid #a7bfad1f; height: 7px; }
#statistics .allocation-fill { background: #fbd9b0; }
#statistics .chart-container-box { padding: 24px; margin-bottom: 24px; }
#statistics .chart-header { gap: 20px; flex-wrap: wrap; }
#statistics .chart-wrapper { height: 300px; background: transparent; }
#statistics .timeframe-selector { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: fit-content; gap: 2px; border: 1px solid #fbd9b080; border-radius: 12px; background: #223c2cb3; padding: 3px; box-shadow: inset 0 1px 0 #fff0dc21, 0 4px 14px #0002; }
#statistics .timeframe-selector::before { content: ''; position: absolute; z-index: -1; inset: 3px auto 3px 3px; width: calc((100% - 10px) / 3); border: 1px solid #ffe5c4; border-radius: 9px; box-sizing: border-box; background: #fbd9b0; box-shadow: inset 0 1px 0 #fff4e280; transition: transform .28s cubic-bezier(.22, 1, .36, 1); pointer-events: none; }
#statistics .timeframe-selector:has([data-timeframe="month"].active)::before { transform: translateX(calc(100% + 2px)); }
#statistics .timeframe-selector:has([data-timeframe="quarter"].active)::before { transform: translateX(calc(200% + 4px)); }
#statistics .tf-btn { border: 1px solid transparent; border-radius: 9px; padding: 6px 12px; min-height: 34px; line-height: 1.4; color: #d2dcd5; background: transparent; box-shadow: none; text-transform: none; font-weight: 400; letter-spacing: 0; transition: color .2s ease, background-color .2s ease; }
#statistics .tf-btn:hover { color: #fbd9b0; background: #fbd9b00a; }
#statistics .tf-btn.active { color: #152017; background: transparent; border-color: transparent; box-shadow: none; font-weight: 500; }
@media (prefers-reduced-motion: reduce) { #statistics .timeframe-selector::before, #statistics .tf-btn { transition: none; } }
#statistics button:focus-visible { outline: 2px solid #fbd9b0; outline-offset: 3px; }
#statistics .stats-update-error { color: #f1a79e; font-size: 14px; }
#statistics .api-admin, #statistics .capital-editor { padding: 24px; }
#statistics :is(.api-admin summary, .api-admin label) { color: #e3e8e2; }
#statistics :is(input, .api-admin .glass-select-trigger) { color: #e3e8e2; background: #09180f80; border-color: #fbd9b033; }
#statistics :is(.api-admin-actions button, .outline-btn) { color: #152017; background: linear-gradient(120deg, #ffe5c4, #f4cea0); border-color: #fbd9b0; }
@media (max-width: 1050px) { #statistics .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } #statistics .allocation-positions-container { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  body.dashboard-wallpaper #statistics .api-page-heading h2 { font-size: 52px; letter-spacing: -1.5px; }
  #statistics .api-page-heading { gap: 24px; }
  #statistics .api-preset-picker { width: 100%; max-width: none; }
  #statistics .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  #statistics .stat-card { padding: 18px 14px; }
  #statistics :is(.allocation-panel, .positions-panel, .chart-container-box) { padding: 18px; }
  #statistics .chart-wrapper { height: 260px; }
  #statistics :is(.panel-title, .chart-header h3) { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { body.dashboard-wallpaper #statistics .api-page-heading h2 { animation: none; } #statistics .stat-card { transition: none; transform: none; } }
#statistics .allocation-donut { position: relative; width: 210px; height: 210px; margin: 4px auto 28px; }

#statistics .allocation-list { width: 100%; max-width: 420px; margin-inline: auto; }

#statistics .api-admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }
#statistics .api-admin-actions #api-preset-delete {
  color: #f2b5ad; background: #71312a20; border-color: #ef9c8c55;
}
#statistics .api-admin-actions #api-preset-delete:hover:not(:disabled) { background: #71312a40; border-color: #ef9c8c99; }
#statistics .api-admin-actions #api-preset-delete:disabled { opacity: .4; cursor: not-allowed; }
