/* =========================================================
   VIEW: History
   ========================================================= */

.history-tabs {
  display: flex;
  gap: 1px;
  background: var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: var(--space-md);
  width: fit-content;
}

.history-tab {
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.history-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.history-tab.is-active {
  color: var(--text-primary);
  background: var(--bg-hover);
  font-weight: 600;
}

.history-filters {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.history-search {
  position: relative;
  width: 240px;
}

.history-search .search-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.history-search input {
  width: 100%;
  padding: var(--space-xs) var(--space-sm) var(--space-xs) 28px;
}

.history-date-range {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.history-date-range input {
  width: 140px;
}

.history-table-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 400px;
}

.history-table-header,
.history-table-row {
  display: grid;
  grid-template-columns: 100px 100px 80px 1fr 1fr 80px 1fr 80px;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  gap: var(--space-md);
}

.history-table-header {
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-table-row {
  border-bottom: 1px solid var(--border-color);
  font-size: var(--font-size-sm);
  transition: background var(--transition-fast);
}

.history-table-row:hover {
  background: var(--bg-hover);
}

.history-table-row:last-child {
  border-bottom: none;
}

.trade-side {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-align: center;
  width: fit-content;
}

.trade-side.buy {
  color: var(--accent-green);
  background: var(--accent-green-dim);
}

.trade-side.sell {
  color: var(--accent-red);
  background: var(--accent-red-dim);
}

.order-status {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-align: center;
  width: fit-content;
}

.order-status.pending {
  color: var(--accent-yellow);
  background: rgba(240, 185, 11, 0.15);
}

.order-status.filled,
.order-status.completed {
  color: var(--accent-green);
  background: var(--accent-green-dim);
}

.order-status.cancelled {
  color: var(--text-muted);
  background: var(--bg-hover);
}

.history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-md);
  padding: var(--space-md);
}

.page-info {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}
