/* ═══════════════════════════════════════════
   TRANSFER HISTORY — Glassmorphic theme
═══════════════════════════════════════════ */

/* Layout */
.th-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}

/* ── How It Works Banner ── */
.th-how-banner {
  background: var(--glass-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.10),
    inset -1px -1px 0 rgba(0,0,0,0.06);
  overflow: hidden;
  margin-bottom: 20px;
}
body.nx-light .th-how-banner {
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.55),
    inset -1px -1px 0 rgba(100,140,220,0.08);
}

.th-how-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.th-how-hdr-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(108,143,255,0.14);
  border: 1px solid rgba(108,143,255,0.28);
  color: var(--accent);
  font-size: 15px;
  flex-shrink: 0;
}
.th-how-hdr-text .th-how-title {
  font-size: 12.5px; font-weight: 700;
  color: var(--white); letter-spacing: 0.2px;
  transition: color 0.35s;
}
body.nx-light .th-how-hdr-text .th-how-title { color: #0a1628; }
.th-how-hdr-text .th-how-sub {
  font-size: 10px; color: var(--white-40); margin-top: 1px;
  transition: color 0.35s;
}
body.nx-light .th-how-hdr-text .th-how-sub { color: rgba(10,22,60,0.50); }

/* Collapse toggle arrow */
.th-how-toggle {
  margin-left: auto;
  font-size: 14px;
  color: var(--white-30);
  transition: transform 0.25s, color 0.25s;
  flex-shrink: 0;
}
body.nx-light .th-how-toggle { color: rgba(10,22,60,0.30); }
.th-how-banner.collapsed .th-how-toggle { transform: rotate(-90deg); }
.th-how-steps-wrap {
  overflow: hidden;
  transition: max-height 0.3s ease;
  max-height: 400px;
}
.th-how-banner.collapsed .th-how-steps-wrap { max-height: 0; }

.th-how-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0;
}
.th-how-step {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 18px 20px;
  position: relative;
}
.th-how-step + .th-how-step::before {
  content: '';
  position: absolute;
  left: 0; top: 18px; bottom: 18px;
  width: 1px;
  background: var(--glass-border);
}
.th-step-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.th-step-icon.green  { background: rgba(52,211,153,0.13); border: 1px solid rgba(52,211,153,0.30); color: var(--green); }
.th-step-icon.blue   { background: rgba(108,143,255,0.13); border: 1px solid rgba(108,143,255,0.30); color: var(--accent); }
.th-step-icon.yellow { background: rgba(251,191,36,0.13); border: 1px solid rgba(251,191,36,0.30); color: var(--orange); }

.th-step-text { min-width: 0; }
.th-step-num {
  font-size: 8.5px; font-weight: 700; letter-spacing: 1.3px;
  text-transform: uppercase; color: var(--white-20);
  margin-bottom: 3px; transition: color 0.35s;
}
body.nx-light .th-step-num { color: rgba(10,22,60,0.32); }
.th-step-body {
  font-size: 11.5px; color: var(--white-60); line-height: 1.5;
  transition: color 0.35s;
}
body.nx-light .th-step-body { color: rgba(10,22,60,0.68); }

/* ── Main History Card ── */
.th-card {
  background: var(--glass-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.10),
    inset -1px -1px 0 rgba(0,0,0,0.06);
  overflow: hidden;
  transition: background 0.35s, border-color 0.35s;
}
body.nx-light .th-card {
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.55),
    inset -1px -1px 0 rgba(100,140,220,0.08);
}

.th-card-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--glass-border);
}
.th-card-hdr-left {
  display: flex; align-items: center; gap: 10px;
}
.th-card-hdr-icon {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  background: rgba(52,211,153,0.12);
  border: 1px solid rgba(52,211,153,0.28);
  color: var(--green);
  flex-shrink: 0;
}
.th-card-title {
  font-size: 12px; font-weight: 700;
  color: var(--white); letter-spacing: 0.3px;
  transition: color 0.35s;
}
body.nx-light .th-card-title { color: #0a1628; }
.th-card-sub {
  font-size: 9.5px; color: var(--white-40); margin-top: 1px;
  transition: color 0.35s;
}
body.nx-light .th-card-sub { color: rgba(10,22,60,0.50); }

.th-count-badge {
  font-size: 10px; font-weight: 700;
  background: var(--accent-dim);
  border: 1px solid rgba(108,143,255,0.30);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Filter tabs */
.th-filter-bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--glass-border);
  flex-wrap: wrap;
}
.th-filter-btn {
  font-size: 10.5px; font-weight: 600;
  padding: 5px 13px;
  border-radius: 99px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--white-40);
  cursor: pointer;
  transition: all 0.18s;
  font-family: var(--font);
  letter-spacing: 0.3px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.th-filter-btn:hover {
  background: var(--glass-hover);
  color: var(--white-80);
}
.th-filter-btn.active {
  background: var(--accent-dim);
  border-color: rgba(108,143,255,0.40);
  color: var(--accent);
}
body.nx-light .th-filter-btn { color: rgba(10,22,60,0.48); }
body.nx-light .th-filter-btn.active { color: #3a6aee; background: rgba(58,106,238,0.12); border-color: rgba(58,106,238,0.35); }

/* ── Desktop Transfer Table ── */
.th-table-wrap { overflow-x: auto; }
.th-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.th-table thead th {
  font-size: 9px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--white-30);
  padding: 10px 18px 9px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
  transition: color 0.35s;
}
body.nx-light .th-table thead th { color: rgba(10,22,60,0.40); }

.th-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
  cursor: default;
}
.th-table tbody tr:last-child { border-bottom: none; }
.th-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}
body.nx-light .th-table tbody tr:hover { background: rgba(58,106,238,0.04); }
body.nx-light .th-table tbody tr { border-bottom-color: rgba(100,150,230,0.10); }

.th-table tbody td {
  padding: 13px 18px;
  vertical-align: middle;
  color: var(--white-70);
  transition: color 0.35s;
}
body.nx-light .th-table tbody td { color: rgba(10,22,60,0.72); }

/* Transfer ID */
.th-tid {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  background: rgba(108,143,255,0.10);
  border: 1px solid rgba(108,143,255,0.22);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
body.nx-light .th-tid { color: #3a6aee; background: rgba(58,106,238,0.08); border-color: rgba(58,106,238,0.22); }

/* User cell */
.th-user-cell {
  display: flex; align-items: center; gap: 10px;
}
.th-user-av {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--glass-border);
  background: var(--glass-card);
  flex-shrink: 0;
}
.th-user-name { font-size: 12px; font-weight: 600; color: var(--white-90); line-height: 1.2; transition: color 0.35s; }
body.nx-light .th-user-name { color: #0a1628; }
.th-user-handle { font-size: 10px; color: var(--white-30); margin-top: 1px; transition: color 0.35s; }
body.nx-light .th-user-handle { color: rgba(10,22,60,0.42); }

/* Direction pill */
.th-dir {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
}
.th-dir.sent {
  background: rgba(248,113,113,0.10);
  border: 1px solid rgba(248,113,113,0.28);
  color: #f87171;
}
.th-dir.received {
  background: rgba(52,211,153,0.10);
  border: 1px solid rgba(52,211,153,0.28);
  color: var(--green);
}

/* Amount */
.th-amount-sent     { color: #f87171; font-weight: 700; font-size: 13px; }
.th-amount-received { color: var(--green); font-weight: 700; font-size: 13px; }

/* Message */
.th-msg {
  font-size: 11px; color: var(--white-40);
  font-style: italic;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.35s;
}
body.nx-light .th-msg { color: rgba(10,22,60,0.42); }

/* Date */
.th-date {
  font-size: 10.5px; color: var(--white-30);
  white-space: nowrap;
  transition: color 0.35s;
}
body.nx-light .th-date { color: rgba(10,22,60,0.38); }

/* Empty state */
.th-empty {
  text-align: center;
  padding: 56px 24px;
}
.th-empty-icon {
  font-size: 40px;
  color: var(--white-10);
  margin-bottom: 14px;
  display: block;
  transition: color 0.35s;
}
body.nx-light .th-empty-icon { color: rgba(10,22,60,0.12); }
.th-empty-title {
  font-size: 14px; font-weight: 700;
  color: var(--white-50); margin-bottom: 6px;
  transition: color 0.35s;
}
body.nx-light .th-empty-title { color: rgba(10,22,60,0.45); }
.th-empty-sub { font-size: 12px; color: var(--white-30); transition: color 0.35s; }
body.nx-light .th-empty-sub { color: rgba(10,22,60,0.32); }

/* ── Mobile Card List (replaces table on small screens) ── */
.th-mobile-list { display: none; }

.th-mobile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
body.nx-light .th-mobile-row { border-bottom-color: rgba(100,150,230,0.10); }
.th-mobile-row:last-child { border-bottom: none; }
.th-mobile-row:active { background: rgba(255,255,255,0.04); }
body.nx-light .th-mobile-row:active { background: rgba(58,106,238,0.04); }

.th-mob-av-wrap { position: relative; flex-shrink: 0; }
.th-mob-av {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--glass-border);
  background: var(--glass-card);
  display: block;
}
.th-mob-dir-dot {
  position: absolute;
  bottom: -1px; right: -1px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--glass-frame);
  display: flex; align-items: center; justify-content: center;
  font-size: 7px;
}
.th-mob-dir-dot.sent     { background: rgba(248,113,113,0.9); color: #fff; }
.th-mob-dir-dot.received { background: rgba(52,211,153,0.9);  color: #fff; }

.th-mob-body { flex: 1; min-width: 0; }
.th-mob-top {
  display: flex; align-items: baseline;
  justify-content: space-between; gap: 6px;
}
.th-mob-name {
  font-size: 13px; font-weight: 700;
  color: var(--white-90);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color 0.35s;
}
body.nx-light .th-mob-name { color: #0a1628; }
.th-mob-amount-sent     { font-size: 13px; font-weight: 700; color: #f87171; white-space: nowrap; flex-shrink: 0; }
.th-mob-amount-received { font-size: 13px; font-weight: 700; color: var(--green); white-space: nowrap; flex-shrink: 0; }
.th-mob-bottom {
  display: flex; align-items: center;
  justify-content: space-between; gap: 6px;
  margin-top: 3px;
}
.th-mob-meta {
  display: flex; align-items: center; gap: 6px;
  min-width: 0;
}
.th-mob-handle { font-size: 10px; color: var(--accent); transition: color 0.35s; }
body.nx-light .th-mob-handle { color: #3a6aee; }
.th-mob-msg {
  font-size: 10px; color: var(--white-30); font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 110px;
  transition: color 0.35s;
}
body.nx-light .th-mob-msg { color: rgba(10,22,60,0.38); }
.th-mob-date { font-size: 9.5px; color: var(--white-25); white-space: nowrap; flex-shrink: 0; transition: color 0.35s; }
body.nx-light .th-mob-date { color: rgba(10,22,60,0.32); }

/* ── Sidebar: Contact Cards ── */
.th-sidebar { display: flex; flex-direction: column; gap: 14px; }

.th-contacts-hdr {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--glass-border);
}
.th-contacts-icon {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  background: rgba(167,139,250,0.12);
  border: 1px solid rgba(167,139,250,0.28);
  color: #bf9fff;
  flex-shrink: 0;
}

.th-contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
body.nx-light .th-contact-item { border-bottom-color: rgba(100,150,230,0.10); }
.th-contact-item:last-child { border-bottom: none; }
.th-contact-item:hover { background: rgba(255,255,255,0.03); }
body.nx-light .th-contact-item:hover { background: rgba(58,106,238,0.04); }

.th-contact-av-wrap { position: relative; flex-shrink: 0; }
.th-contact-av {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--glass-border);
  background: var(--glass-card);
  display: block;
}
.th-contact-badge {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--glass-frame);
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

.th-contact-info { flex: 1; min-width: 0; }
.th-contact-name {
  font-size: 12px; font-weight: 700;
  color: var(--white-90); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  transition: color 0.35s;
}
body.nx-light .th-contact-name { color: #0a1628; }
.th-contact-handle {
  font-size: 10px; color: var(--accent); margin-top: 1px;
  transition: color 0.35s;
}
body.nx-light .th-contact-handle { color: #3a6aee; }

.th-contact-meta { text-align: right; flex-shrink: 0; }
.th-contact-total {
  font-size: 12px; font-weight: 700; color: var(--green);
  transition: color 0.35s;
}
.th-contact-count {
  font-size: 9px; color: var(--white-30);
  margin-top: 2px; transition: color 0.35s;
  white-space: nowrap;
}
body.nx-light .th-contact-count { color: rgba(10,22,60,0.38); }

.th-contact-tid {
  font-family: 'Courier New', monospace;
  font-size: 9px;
  color: var(--white-20);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
  text-align: right;
  transition: color 0.35s;
}
body.nx-light .th-contact-tid { color: rgba(10,22,60,0.28); }

/* Summary strip */
.th-summary-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  background: var(--glass-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.08),
    inset -1px -1px 0 rgba(0,0,0,0.04);
}
body.nx-light .th-summary-strip {
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.55),
    inset -1px -1px 0 rgba(100,140,220,0.08);
}

.th-summary-item {
  padding: 16px 12px;
  position: relative;
  text-align: center;
}
.th-summary-item + .th-summary-item::before {
  content: '';
  position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 1px; background: var(--glass-border);
}
.th-summary-label {
  font-size: 9px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--white-30);
  margin-bottom: 6px; transition: color 0.35s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.nx-light .th-summary-label { color: rgba(10,22,60,0.38); }
.th-summary-val {
  font-size: 20px; font-weight: 800;
  letter-spacing: -0.5px; line-height: 1;
  transition: color 0.35s;
}

/* ── Responsive Breakpoints ── */
@media (max-width: 900px) {
  .th-layout { grid-template-columns: 1fr; }
  .th-how-steps { grid-template-columns: 1fr; }
  .th-how-step + .th-how-step::before { left: 0; top: 0; bottom: auto; width: 100%; height: 1px; }
}

@media (max-width: 640px) {
  /* Summary: smaller font on mobile */
  .th-summary-val { font-size: 15px; letter-spacing: -0.3px; }
  .th-summary-label { font-size: 8px; letter-spacing: 0.8px; }
  .th-summary-item { padding: 13px 8px; }

  /* Hide desktop table, show mobile card list */
  .th-table-wrap { display: none; }
  .th-mobile-list { display: block; }

  /* How It Works: collapsed by default on mobile */
  .th-how-hdr { cursor: pointer; }

  /* Card header on mobile */
  .th-card-hdr { padding: 12px 14px 10px; flex-wrap: wrap; gap: 8px; }
  .th-count-badge { font-size: 9px; padding: 2px 8px; }

  /* Filter bar: full-width buttons */
  .th-filter-bar { padding: 8px 10px; gap: 5px; }
  .th-filter-btn { flex: 1; text-align: center; padding: 7px 8px; font-size: 10px; min-height: 34px; }
}

@media (max-width: 380px) {
  .th-summary-val { font-size: 13px; }
  .th-summary-label { font-size: 7.5px; letter-spacing: 0.5px; }
}