:root {
 --wallet-sidebar-width: var(--sidebar-width, 280px);
  --wallet-bg: #f7f7fb;
  --wallet-card: #ffffff;
  --wallet-text: #171717;
  --wallet-muted: #77788d;
  --wallet-border: #eae8f1;
  --wallet-surface: #f7f7fc;
  --wallet-primary: #6355e7;
  --wallet-shadow: 0 8px 25px rgba(0, 0, 0, 0.035);
}

html[data-theme="dark"] {
  --wallet-bg: #0b1120;
  --wallet-card: #151e30;
  --wallet-text: #f1f5f9;
  --wallet-muted: #a1abc0;
  --wallet-border: #29364b;
  --wallet-surface: #1c2940;
  --wallet-primary: #a39aff;
  --wallet-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
}

* {
  box-sizing: border-box;
}

.wallet-page {
  margin: 0;
  min-height: 100vh;
  background: var(--wallet-bg);
  color: var(--wallet-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background 0.25s ease, color 0.25s ease;
}

.wallet-layout {
    width: 100%;
    min-height: 100vh;
    margin-left: 0;
    transition: width 0.3s ease, margin-left 0.3s ease;
}

/* Host desktop layout */
@media (min-width: 901px) {
    body.host-layout .wallet-layout {
        width: calc(100% - var(--sidebar-width, 280px));
        margin-left: var(--sidebar-width, 280px);
    }
}

/* Navbar always spans the full screen */
.wallet-page .eventure-navbar {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1200;
}

/* Mobile layout */
@media (max-width: 900px) {
    body.host-layout .wallet-layout {
        width: 100%;
        margin-left: 0;
    }
}

.wallet-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 38px 32px 50px;
  box-sizing: border-box;
}

.wallet-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 30px;
}

.wallet-eyebrow {
  margin: 0 0 10px;
  color: var(--wallet-primary);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.wallet-header h1 {
  margin: 0;
  color: var(--wallet-text);
  font-size: clamp(34px, 4vw, 46px);
  letter-spacing: -1.8px;
  font-weight: 750;
}

.wallet-header > div > p:last-child {
  margin: 12px 0 0;
  color: var(--wallet-muted);
  font-size: 14px;
  line-height: 1.6;
}

.history-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--wallet-border);
  border-radius: 13px;
  background: var(--wallet-card);
  color: var(--wallet-primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  transition: 0.2s ease;
}

.history-shortcut:hover {
  background: var(--wallet-surface);
  border-color: var(--wallet-primary);
  color: var(--wallet-primary);
  transform: translateY(-2px);
}

.wallet-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 20px;
}

.balance-card {
  min-height: 220px;
  padding: 30px 34px;
  border-radius: 23px;
  background: linear-gradient(120deg, #6956e8 0%, #5141c8 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(91, 72, 220, 0.17);
}

.balance-card::before,
.balance-card::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  pointer-events: none;
}

.balance-card::before {
  width: 260px;
  height: 260px;
  right: -90px;
  top: -145px;
}

.balance-card::after {
  width: 190px;
  height: 190px;
  right: -55px;
  top: -105px;
}

.balance-card-top,
.balance-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.balance-label {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.7px;
}

.balance-card h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(35px, 5vw, 46px);
  font-weight: 750;
  letter-spacing: -1.5px;
}

.wallet-card-icon {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
  font-size: 23px;
  flex-shrink: 0;
}

.balance-card-bottom {
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 12px;
}

.balance-card-bottom > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.balance-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #79edb3;
}

.wallet-currency {
  color: rgba(255, 255, 255, 0.75);
}

.wallet-info-card {
  min-height: 220px;
  padding: 27px;
  border: 1px solid var(--wallet-border);
  border-radius: 23px;
  background: var(--wallet-card);
  color: var(--wallet-text);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--wallet-shadow);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.wallet-info-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(99, 85, 231, 0.12);
  color: var(--wallet-primary);
  font-size: 19px;
}

.wallet-info-card h3 {
  margin: 15px 0 8px;
  color: var(--wallet-text);
  font-size: 17px;
  letter-spacing: -0.4px;
}

.wallet-info-card p {
  margin: 0;
  color: var(--wallet-muted);
  font-size: 12px;
  line-height: 1.7;
}

.wallet-info-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: #20a36b;
  font-size: 11px;
  font-weight: 650;
}

.wallet-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.stat-card {
  padding: 23px;
  border: 1px solid var(--wallet-border);
  border-radius: 19px;
  background: var(--wallet-card);
  color: var(--wallet-text);
  box-shadow: var(--wallet-shadow);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 15px;
  flex-shrink: 0;
}

.credit-icon {
  background: rgba(32, 163, 107, 0.12);
  color: #20a36b;
}

.debit-icon {
  background: rgba(225, 93, 73, 0.12);
  color: #e15d49;
}

.transaction-icon {
  background: rgba(99, 85, 231, 0.12);
  color: var(--wallet-primary);
}

.stat-label {
  color: var(--wallet-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.2px;
}

.stat-card h3 {
  margin: 18px 0 5px;
  color: var(--wallet-text);
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -0.8px;
}

.stat-card p {
  margin: 0;
  color: var(--wallet-muted);
  font-size: 12px;
}

.transactions-section {
  margin-top: 30px;
  padding: 28px;
  border: 1px solid var(--wallet-border);
  border-radius: 22px;
  background: var(--wallet-card);
  color: var(--wallet-text);
  box-shadow: var(--wallet-shadow);
  scroll-margin-top: 100px;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.transactions-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.transactions-header h2 {
  margin: 0;
  color: var(--wallet-text);
  font-size: 24px;
  letter-spacing: -0.8px;
}

.transactions-header > div:first-child > p:last-child {
  margin: 8px 0 0;
  color: var(--wallet-muted);
  font-size: 12px;
}

.transaction-filters {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px;
  border-radius: 12px;
  background: var(--wallet-surface);
}

.filter-btn {
  min-height: 34px;
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--wallet-muted);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: 0.2s ease;
}

.filter-btn.active {
  background: var(--wallet-card);
  color: var(--wallet-primary);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.08);
}

.transaction-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.transaction-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.transaction-table thead {
  background: var(--wallet-surface);
}

.transaction-table th {
  padding: 15px 14px;
  color: var(--wallet-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1px;
  white-space: nowrap;
}

.transaction-table td {
  padding: 17px 14px;
  border-bottom: 1px solid var(--wallet-border);
  color: var(--wallet-muted);
  font-size: 12px;
  white-space: nowrap;
}

.transaction-table tbody tr:last-child td {
  border-bottom: 0;
}

.transaction-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.transaction-icon-small {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 11px;
  background: rgba(99, 85, 231, 0.12);
  color: var(--wallet-primary);
}

.transaction-title strong {
  display: block;
  color: var(--wallet-text);
  font-size: 12px;
}

.transaction-title small {
  display: block;
  margin-top: 4px;
  color: var(--wallet-muted);
  font-size: 10px;
}

.transaction-type {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
}

.transaction-type.credit {
  background: rgba(32, 163, 107, 0.12);
  color: #20a36b;
}

.transaction-type.debit {
  background: rgba(225, 93, 73, 0.12);
  color: #e15d49;
}

.transaction-amount {
  font-weight: 750;
  font-size: 13px;
}

.transaction-amount.credit {
  color: #20a36b;
}

.transaction-amount.debit {
  color: #e15d49;
}

.transaction-loading,
.transaction-empty,
.transaction-error {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--wallet-muted);
  font-size: 13px;
}

.transaction-empty strong {
  color: var(--wallet-text);
}

.transaction-empty i,
.transaction-error i {
  color: var(--wallet-primary);
  font-size: 30px;
}

.loading-spinner {
  width: 25px;
  height: 25px;
  border: 3px solid rgba(99, 85, 231, 0.18);
  border-top-color: var(--wallet-primary);
  border-radius: 50%;
  animation: walletSpin 0.8s linear infinite;
}

.transaction-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-top: 18px;
  border-top: 1px solid var(--wallet-border);
}

.transaction-footer p {
  margin: 0;
  color: var(--wallet-muted);
  font-size: 11px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--wallet-muted);
  font-size: 11px;
}

.pagination-controls button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--wallet-border);
  border-radius: 10px;
  background: var(--wallet-card);
  color: var(--wallet-primary);
  cursor: pointer;
  transition: 0.2s ease;
}

.pagination-controls button:hover:not(:disabled) {
  background: var(--wallet-surface);
  border-color: var(--wallet-primary);
}

.pagination-controls button:disabled {
  color: var(--wallet-muted);
  cursor: not-allowed;
  opacity: 0.45;
}

.mobile-transactions {
  display: none;
}

.wallet-footer-note {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
  padding: 20px 23px;
  border: 1px solid var(--wallet-border);
  border-radius: 17px;
  background: var(--wallet-card);
  color: var(--wallet-text);
  box-shadow: var(--wallet-shadow);
}

.footer-note-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: rgba(99, 85, 231, 0.12);
  color: var(--wallet-primary);
}

.wallet-footer-note h3 {
  margin: 0 0 5px;
  color: var(--wallet-text);
  font-size: 12px;
}

.wallet-footer-note p {
  margin: 0;
  color: var(--wallet-muted);
  font-size: 11px;
  line-height: 1.6;
}

html[data-theme="dark"] .wallet-page {
  background: var(--wallet-bg);
}

html[data-theme="dark"] .transaction-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

html[data-theme="dark"] .mobile-transaction-card {
  background: var(--wallet-card);
  border-color: var(--wallet-border);
}

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

@media (max-width: 1100px) {
  .wallet-content {
    padding: 32px 25px 45px;
  }

  .wallet-overview {
    grid-template-columns: 1fr;
  }

  .wallet-info-card {
    min-height: 190px;
  }
}

@media (max-width: 900px) {
  body.host-layout .wallet-layout {
    width: 100%;
    margin-left: 0;
  }

  .wallet-content {
    padding: 30px 22px 45px;
  }

  .wallet-stats {
    gap: 13px;
  }
}

@media (max-width: 750px) {
  .wallet-content {
    padding: 25px 18px 40px;
  }

  .wallet-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .history-shortcut {
    width: 100%;
  }

  .wallet-stats {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 19px;
  }

  .stat-card h3 {
    margin-top: 13px;
  }

  .transactions-section {
    padding: 21px 15px;
  }

  .transactions-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .transaction-filters {
    width: 100%;
  }

  .filter-btn {
    flex: 1;
  }

  .transaction-table {
    min-width: 650px;
  }

  .transaction-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .balance-card {
    padding: 26px 23px;
  }

  .wallet-info-card {
    padding: 23px;
  }
}

@media (max-width: 500px) {
  .wallet-header h1 {
    font-size: 35px;
  }

  .balance-card h2 {
    font-size: 36px;
  }

  .balance-card-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .transaction-table-wrapper {
    overflow: visible;
  }

  .transaction-table {
    display: none;
  }

  .mobile-transactions {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .mobile-transaction-card {
    padding: 15px;
    border: 1px solid var(--wallet-border);
    border-radius: 14px;
    background: var(--wallet-card);
  }

  .mobile-transaction-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }

  .mobile-transaction-bottom {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 13px;
    padding-top: 11px;
    border-top: 1px solid var(--wallet-border);
    color: var(--wallet-muted);
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wallet-page,
  .wallet-info-card,
  .stat-card,
  .history-shortcut {
    transition: none;
  }

  .loading-spinner {
    animation-duration: 1.5s;
  }
}