:root {
  --bg-primary: #0a0e14;
  --bg-card: #111318;
  --bg-input: #0d1117;
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #fff;
  --text-secondary: rgba(255, 255, 255, 0.5);
  --accent-green: #10b981;
  --accent-cyan: #06b6d4;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: #0a0e14 !important;
  background-color: #0a0e14 !important;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary) !important;
  background-color: #0a0e14 !important;
  color: var(--text-primary);
  min-height: 100vh;
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

.header {
  display: flex;
  align-items: center;
  padding: 1rem;
  position: sticky;
  top: 0;
  background: #0a0e14 !important;
  background-color: #0a0e14 !important;
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
}

.back-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

.header-title {
  flex: 1;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  margin-right: 40px;
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(13, 17, 23, 0.9) !important;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-tab:hover {
  background: rgba(13, 17, 23, 0.9) !important;
  color: var(--text-primary);
}

.filter-tab.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.summary-section {
  padding: 1rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(234, 88, 12, 0.08));
  border-bottom: 1px solid var(--border-color);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.summary-item {
  text-align: center;
}

.summary-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.summary-value.green {
  color: var(--accent-green);
}

.summary-value.red {
  color: var(--accent-red);
}

.summary-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.transaction-list {
  padding: 1rem;
  background-color: #0a0e14;
}

.transaction-item {
  background: var(--bg-card);
  background-color: #111318;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.transaction-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.transaction-item:active {
  transform: scale(0.99);
}

.tx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.tx-type {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tx-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tx-icon.deposit {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.tx-icon.withdraw {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.tx-icon.convert {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.tx-icon.trade {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-orange);
}

.tx-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
}

.tx-info span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.tx-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.tx-status.pending {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.tx-status.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tx-status.failed {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.tx-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.tx-detail {
  display: flex;
  justify-content: space-between;
}

.tx-detail-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.tx-detail-value {
  font-size: 0.75rem;
  color: var(--text-primary);
  font-weight: 500;
}

.tx-detail-value.green {
  color: var(--accent-green);
}

.tx-detail-value.red {
  color: var(--accent-red);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  opacity: 0.3;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.85rem;
}

/* Detail Modal */
.detail-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.detail-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.detail-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  background-color: #111318;
  border-radius: 1.5rem 1.5rem 0 0;
  max-height: 80vh;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.detail-modal-overlay.active .detail-modal {
  transform: translateY(0);
}

.detail-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.detail-modal-title {
  font-size: 1rem;
  font-weight: 600;
}

.detail-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  max-height: calc(80vh - 60px);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.detail-value {
  font-size: 0.85rem;
  font-weight: 500;
  text-align: right;
  word-break: break-all;
  max-width: 60%;
}

.detail-value.green {
  color: var(--accent-green);
}

.detail-value.red {
  color: var(--accent-red);
}