/* History Page */

.history-main {
  padding: 28px 40px 80px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Header */
.history-header {
  margin-bottom: 24px;
}

.history-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}

.history-header p {
  font-size: 13px;
  color: #8a94a6;
  margin: 0;
}

/* Tabs */
.history-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #1e2536;
  margin-bottom: 20px;
  overflow-x: auto;
}

.history-tab {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #8a94a6;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.history-tab:hover {
  color: #ccd6e0;
}

.history-tab.active {
  color: #5cb8e6;
  border-bottom-color: #5cb8e6;
}

/* Filters bar */
.history-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.history-filter-select,
.history-filter-input {
  padding: 8px 12px;
  font-size: 13px;
  background: #141926;
  border: 1px solid #1e2536;
  border-radius: 6px;
  color: #ccd6e0;
  outline: none;
}

.history-filter-select:focus,
.history-filter-input:focus {
  border-color: #5cb8e6;
}

.history-filter-input {
  width: 140px;
}

.history-filter-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: #1e2536;
  border: 1px solid #2a3248;
  border-radius: 6px;
  color: #8a94a6;
  cursor: pointer;
  transition: background 0.15s;
}

.history-filter-btn:hover {
  background: #2a3248;
  color: #ccd6e0;
}

/* Table */
.history-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #1e2536;
  background: #0f1319;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.history-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #8a94a6;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #141926;
  border-bottom: 1px solid #1e2536;
  white-space: nowrap;
}

.history-table tbody td {
  padding: 12px 16px;
  color: #ccd6e0;
  border-bottom: 1px solid #1a1f2e;
  white-space: nowrap;
}

.history-table tbody tr:last-child td {
  border-bottom: none;
}

.history-table tbody tr:hover {
  background: #141926;
}

/* Category badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-deposit {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.badge-withdrawal {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.badge-futures {
  background: rgba(92, 184, 230, 0.15);
  color: #5cb8e6;
}

.badge-spot {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.badge-options {
  background: rgba(224, 160, 80, 0.15);
  color: #e0a050;
}

.badge-fee {
  background: rgba(138, 148, 166, 0.15);
  color: #8a94a6;
}

/* Side badges */
.side-buy, .side-long {
  color: #5cb8e6;
  font-weight: 600;
}

.side-sell, .side-short {
  color: #e0a050;
  font-weight: 600;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.status-liquidated {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.status-reserved {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.status-released {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.status-filled, .status-completed, .status-confirmed {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.status-pending, .status-processing {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.status-cancelled, .status-failed {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.status-open {
  background: rgba(92, 184, 230, 0.15);
  color: #5cb8e6;
}

/* Amount positive/negative */
.amount-positive { color: #22c55e; }
.amount-negative { color: #ef4444; }

/* Empty state */
.history-empty {
  text-align: center;
  padding: 60px 20px;
  color: #8a94a6;
}

.history-empty svg {
  margin-bottom: 16px;
  opacity: 0.4;
}

.history-empty p {
  font-size: 14px;
  margin: 0;
}

/* Loading */
.history-loading {
  text-align: center;
  padding: 40px 20px;
  color: #8a94a6;
}

.history-loading .spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid #1e2536;
  border-top-color: #5cb8e6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1024px) {
  .history-main { padding: 24px 20px 60px; }
}
@media (max-width: 768px) {
  .history-main {
    padding: 20px 16px 60px;
  }

  .history-tabs {
    gap: 0;
  }

  .history-tab {
    padding: 10px 14px;
    font-size: 12px;
  }

  .history-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .history-filter-input {
    width: 100%;
  }
}
