#trade-history { --trade-panel-background: linear-gradient(120deg, #16281ed0, #102118d0); --trade-panel-border: #a7bfad2e; }
body.dashboard-wallpaper #trade-history .trade-history-title {
  display: inline-block; margin: 0 0 36px; color: #fbd9b0; 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;
}
#trade-history .api-history-source, #trade-history .trade-search {
  display: flex; align-items: center; gap: 18px; padding: 18px 24px; margin-bottom: 20px;
  border: 1px solid var(--trade-panel-border); border-radius: 22px; background: var(--trade-panel-background);
  color: #e4e8e3; font-size: 18px; box-shadow: inset 0 1px 0 #ffffff05;
}
#trade-history .api-history-source svg, #trade-history .trade-search svg { flex-shrink: 0; width: 24px; height: 24px; color: #fbd9b0; }
#trade-history .trade-search svg { color: #aeb8b2; }
#trade-history .trade-search:focus-within { border-color: #fbd9b099; }
#trade-history .trade-search input {
  flex: 1; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0;
  outline: none; background: transparent; box-shadow: none; color: #edf0eb; font: inherit;
}
#trade-history .trade-search input::placeholder { color: #89968e; }
#trade-history .trade-side-filter {
  display: flex; gap: 6px; padding: 6px; margin-bottom: 24px; border: 1px solid var(--trade-panel-border);
  border-radius: 100px; background: var(--trade-panel-background);
}
#trade-history .trade-side-filter button {
  flex: 1; margin: 0; padding: 14px; border: 1px solid transparent; border-radius: 100px;
  color: #b4bdb7; background: transparent; box-shadow: none; font-size: 17px; font-weight: 400;
  transition: background .2s ease, color .2s ease;
}
#trade-history .trade-side-filter button:hover { color: #fff0dc; background: #fbd9b012; }
#trade-history .trade-side-filter button[aria-pressed="true"] {
  color: #152017; background: linear-gradient(120deg, #ffe5c4, #f4cea0); border-color: #ffe5c499; box-shadow: inset 0 1px 0 #fff4e280;
}
#trade-history button:focus-visible { outline: 2px solid #fbd9b0; outline-offset: 2px; }
#trade-history #api-trades-container { padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; }
#trade-history .table-wrapper { border: 1px solid var(--trade-panel-border); border-radius: 24px; background: var(--trade-panel-background); overflow-x: auto; }
#trade-history .trades-table { min-width: 820px; width: 100%; margin: 0; border-collapse: collapse; background: transparent; }
#trade-history .trades-table thead { background: linear-gradient(120deg, #ffe5c4e0, #f4cea0d6); }
#trade-history .trades-table th { padding: 22px 20px; color: #152017; background: transparent; font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: 0; border-bottom: 1px solid #fbd9b033; }
#trade-history .trades-table td { padding: 22px 20px; color: #e3e8e2; font-size: 15px; border-bottom: 1px solid #ffffff08; white-space: nowrap; }
#trade-history .trades-table td strong { font-weight: 500; }
#trade-history .trades-table tr:last-child td { border-bottom: 0; }
#trade-history .trades-table tbody tr:hover { background: #fbd9b008; }
#trade-history .trades-table .badge { display: inline-block; min-width: 66px; padding: 7px 12px; border-radius: 14px; text-align: center; font-size: 13px; font-weight: 400; }
#trade-history .side-buy { background: #00795330; color: #00d8a0; border: 1px solid #00d8a01a; }
#trade-history .side-sell { background: #8f292930; color: #ff6b60; border: 1px solid #ff6b601a; }
#trade-history .trades-table .pnl-positive { color: #00d8a0; }
#trade-history .trades-table .pnl-negative { color: #ff575d; }
#trade-history .trades-table .muted-cell { color: #9ba99f; font-size: 13px; }
#trade-history .empty-message, #trade-history .error-message { padding: 48px 24px; border: 1px solid var(--trade-panel-border); border-radius: 24px; background: var(--trade-panel-background); color: #b4bdb7; text-align: center; }
#trade-history .error-message { color: #f1a79e; }
#trade-history .pagination { color: #aeb8b2; }
#trade-history .pagination span { color: #fbd9b0; }
#trade-history .pagination button { background: #122119; color: #fbd9b0; border-color: #fbd9b055; }
@media (max-width: 768px) {
  body.dashboard-wallpaper #trade-history .trade-history-title { font-size: clamp(48px, 9vw, 70px); letter-spacing: -1.5px; }
  #trade-history .api-history-source, #trade-history .trade-search { padding: 16px 18px; font-size: 16px; gap: 12px; }
  #trade-history .trade-side-filter button { font-size: 15px; padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { body.dashboard-wallpaper #trade-history .trade-history-title { animation: none; } }
#trade-history .api-history-source .glass-select { flex: 1; min-width: 0; }
#trade-history .api-history-source .glass-select-trigger {
  min-height: 24px; padding: 0; border: 0; border-radius: 0; color: #e4e8e3;
  background: transparent; box-shadow: none; backdrop-filter: none; font-size: inherit; font-weight: 400;
}
#trade-history .api-history-source:focus-within { border-color: #fbd9b099; }
#trade-history .api-history-source .glass-select-trigger:hover { color: #fbd9b0; background: transparent; }
#trade-history .api-history-source .glass-select-trigger:focus-visible { outline: 2px solid #fbd9b0; outline-offset: 6px; border-radius: 4px; }
body .api-preset-menu {
  color: #e4e8e3; border-color: #fbd9b04d; background: linear-gradient(145deg, #1c3024e8, #0e2118ef);
  box-shadow: 0 14px 40px #0005, inset 0 1px 0 #fff0dc15;
}
body .api-preset-menu .glass-select-option.is-active { background: #fbd9b014; box-shadow: inset 0 0 0 1px #fbd9b050; }
body .api-preset-menu .glass-select-option[aria-selected="true"] { background: linear-gradient(120deg, #ffe5c4e0, #f4cea0d6); color: #152017; }

#trade-history .trade-summary { margin-top: 40px; }
#trade-history .trade-summary[hidden] { display: none; }
#trade-history .trade-summary-title { margin: 0 0 10px; color: #e3e8e2; font-size: 24px; font-weight: 500; }
#trade-history .trade-summary-note { margin: 0 0 22px; color: #9ba99f; font-size: 13px; line-height: 1.6; }
#trade-history .trade-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
#trade-history .trade-summary-card, #trade-history .trade-summary-side {
  padding: 24px; border: 1px solid var(--trade-panel-border); border-radius: 22px;
  background: var(--trade-panel-background); box-shadow: inset 0 1px 0 #fff0dc0c;
}
#trade-history .trade-summary-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
#trade-history .trade-summary-label { color: #b4bdb7; font-size: 14px; }
#trade-history .trade-summary-value { color: #e3e8e2; font-size: clamp(22px, 2.5vw, 30px); font-weight: 500; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#trade-history .trade-summary-value.is-positive { color: #00d8a0; }
#trade-history .trade-summary-value.is-negative { color: #ff575d; }
#trade-history .trade-summary-hint { color: #9ba99f; font-size: 12px; line-height: 1.5; margin-top: auto; }
#trade-history .trade-summary-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
#trade-history .trade-summary-side h4 { color: #fbd9b0; font-size: 17px; font-weight: 500; margin: 0 0 18px; }
#trade-history .trade-summary-side-row { display: flex; justify-content: space-between; gap: 12px; color: #b4bdb7; font-size: 14px; padding: 8px 0; }
#trade-history .trade-summary-side-row strong { color: #e3e8e2; font-weight: 500; overflow-wrap: anywhere; text-align: right; }
@media (max-width: 768px) {
  #trade-history .trade-summary { margin-top: 28px; }
  #trade-history .trade-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #trade-history .trade-summary-card, #trade-history .trade-summary-side { padding: 16px; border-radius: 18px; }
  #trade-history .trade-summary-value { font-size: 22px; }
  #trade-history .trade-summary-sides { gap: 10px; }
  #trade-history .trade-summary-side-row { font-size: 12px; flex-wrap: wrap; }
}

#trade-history .trade-summary-card, #trade-history .trade-summary-side {
  transition: transform .2s ease, border-color .2s ease;
}
@media (hover: hover) and (pointer: fine) {
  #trade-history .trade-summary-card:hover, #trade-history .trade-summary-side:hover {
    transform: translateY(-2px); border-color: #fbd9b080;
    box-shadow: inset 0 1px 0 #fff0dc12;
  }
}
@media (prefers-reduced-motion: reduce) {
  #trade-history .trade-summary-card, #trade-history .trade-summary-side { transition: none; }
  #trade-history .trade-summary-card:hover, #trade-history .trade-summary-side:hover { transform: none; }
}
