/* ─── RESET & BASE ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.4s ease;
}

a { text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── THEME CSS VARIABLES ───────────────────────────────── */
:root {
  --icon:        #64b5ff;
  --text:        #fff;
  --bg:          linear-gradient(135deg, #1a1a2e, #16213e);
  --card-grad:   linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  --card-shadow: 0 10px 30px rgba(0,0,0,0.3);
  --header-grad: linear-gradient(90deg, #6a11cb, #2575fc);
}

body.theme-aurora {
  --icon:        #64b5ff;
  --text:        #fff;
  --bg:          linear-gradient(135deg, #1a1a2e, #16213e);
  --card-grad:   linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  --card-shadow: 0 10px 30px rgba(0,0,0,0.3);
  --header-grad: linear-gradient(90deg, #6a11cb, #2575fc);
}

body.theme-emeraldDusk {
  --icon:        #FFD700;
  --text:        #fff;
  --bg:          linear-gradient(135deg, #0A3D2A, #001C17);
  --card-grad:   linear-gradient(135deg, #106342 0%, #0A3D2A 100%);
  --card-shadow: 0 10px 40px rgba(0,0,0,0.5);
  --header-grad: linear-gradient(90deg, #106342, #18A558);
}

body.theme-midnightGold {
  --icon:        #FFD700;
  --text:        #E0E0E0;
  --bg:          linear-gradient(135deg, #000000, #141414);
  --card-grad:   linear-gradient(135deg, #202020 0%, #0D0D0D 100%);
  --card-shadow: 0 10px 40px rgba(255,215,0,0.2);
  --header-grad: linear-gradient(90deg, #1A1A1A, #282828);
}

body.theme-vaporwave {
  --icon:        #00FFFF;
  --text:        #fff;
  --bg:          linear-gradient(135deg, #1B003B, #000D4F);
  --card-grad:   linear-gradient(135deg, #FF00FF 0%, #00FFFF 100%);
  --card-shadow: 0 10px 50px rgba(255,0,255,0.5);
  --header-grad: linear-gradient(90deg, #FF00FF, #00FFFF);
}

/* ─── SCROLLBAR ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* ════════════════════════════════════════════════════════════
   NAVBAR / HEADER BAR
   ════════════════════════════════════════════════════════════ */
.header-bar {
  background: var(--header-grad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 clamp(12px, 3vw, 32px);
  height: clamp(60px, 10vw, 72px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--icon) 20%, transparent);
  transition: background 0.5s ease-in-out, box-shadow 0.3s ease;
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
  cursor: pointer;
  transition: transform 0.2s ease;
  user-select: none;
}
.header-logo:hover { transform: scale(1.03); }

.header-logo-icon {
  width: clamp(40px, 8vw, 48px);
  height: clamp(40px, 8vw, 48px);
  border-radius: clamp(10px, 2vw, 12px);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.header-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: clamp(10px, 2vw, 12px);
}

.header-logo-text {
  display: flex;
  flex-direction: column;
  gap: clamp(2px, 0.5vw, 4px);
}
.header-brand {
  color: #fff;
  font-weight: 800;
  font-size: clamp(16px, 3.5vw, 22px);
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.header-tagline {
  font-size: clamp(7px, 1.3vw, 9px);
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
  background: linear-gradient(90deg, var(--icon), color-mix(in srgb, var(--icon) 80%, transparent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

/* Action icons row */
.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 16px);
  position: relative;
}

.header-icon-btn {
  position: relative;
  width: clamp(40px, 7vw, 44px);
  height: clamp(40px, 7vw, 44px);
  border-radius: clamp(8px, 1.5vw, 10px);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #fff;
  flex-shrink: 0;
}
.header-icon-btn svg {
  width: clamp(16px, 3vw, 20px);
  height: clamp(16px, 3vw, 20px);
}
.header-icon-btn:hover { background: rgba(255,255,255,0.18); transform: scale(1.08); }
.header-icon-btn:active { transform: scale(0.95); }

/* Notification badge count */
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: clamp(16px, 3vw, 20px);
  height: clamp(16px, 3vw, 20px);
  border-radius: 50%;
  background: linear-gradient(135deg, #ff4d4f, #ff7875);
  box-shadow: 0 2px 8px rgba(255,77,79,0.5);
  color: #fff;
  font-size: clamp(9px, 1.5vw, 11px);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid #141414;
}

/* Avatar */
.header-avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: clamp(8px, 1.5vw, 10px);
  background: linear-gradient(135deg, var(--icon), color-mix(in srgb, var(--icon) 60%, transparent));
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 4px 15px color-mix(in srgb, var(--icon) 40%, transparent);
}
.header-avatar svg {
  width: clamp(16px, 3vw, 20px);
  height: clamp(16px, 3vw, 20px);
  color: #fff;
}
.avatar-status-dot {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: clamp(10px, 2vw, 13px);
  height: clamp(10px, 2vw, 13px);
  border-radius: 50%;
  background: #52c41a;
  border: 2px solid #141414;
  box-shadow: 0 0 8px rgba(82,196,26,0.6);
}

/* ─── NOTIFICATIONS DROPDOWN ───────────────────────────── */
.notif-dropdown,
.profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 2000;
  animation: dropIn 0.2s ease;
}
.notif-dropdown.open,
.profile-dropdown.open { display: block; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.notif-dropdown {
  width: min(90vw, 340px);
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-radius: clamp(12px, 2.5vw, 16px);
  padding: clamp(12px, 2.5vw, 16px);
  box-shadow: 0 12px 40px color-mix(in srgb, var(--icon) 30%, transparent);
  border: 1px solid color-mix(in srgb, var(--icon) 30%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* override background with the current header color dynamically via JS — handled with var(--header-grad) fallback */
.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: clamp(12px, 2.5vw, 16px);
  padding-bottom: clamp(10px, 2vw, 12px);
  border-bottom: 1px solid color-mix(in srgb, var(--icon) 20%, transparent);
}
.notif-header-title {
  color: var(--icon);
  font-weight: 700;
  font-size: clamp(14px, 2.5vw, 16px);
  display: flex;
  align-items: center;
}
.notif-count-badge {
  min-width: clamp(18px, 3vw, 22px);
  height: clamp(18px, 3vw, 22px);
  border-radius: 50%;
  background: var(--icon);
  box-shadow: 0 0 10px color-mix(in srgb, var(--icon) 80%, transparent);
  color: #000;
  font-size: clamp(10px, 1.5vw, 12px);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-list { display: flex; flex-direction: column; gap: clamp(6px, 1.5vw, 8px); }

.notif-item {
  display: flex;
  gap: clamp(10px, 2vw, 12px);
  align-items: flex-start;
  padding: clamp(10px, 2vw, 12px);
  border-radius: clamp(10px, 2vw, 12px);
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.25s ease;
}
.notif-item:hover {
  background: linear-gradient(90deg, color-mix(in srgb, var(--icon) 15%, transparent), rgba(255,255,255,0.08));
  border-color: color-mix(in srgb, var(--icon) 40%, transparent);
  transform: translateX(4px);
}
.notif-icon {
  width: clamp(36px, 6vw, 40px);
  height: clamp(36px, 6vw, 40px);
  border-radius: clamp(8px, 1.5vw, 10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(16px, 3vw, 20px);
  flex-shrink: 0;
}
.notif-item-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.notif-msg {
  color: #fff;
  font-size: clamp(11px, 2vw, 13px);
  font-weight: 500;
  line-height: 1.3;
}
.notif-time {
  font-size: clamp(9px, 1.5vw, 11px);
  font-weight: 600;
}

.notif-footer {
  margin-top: clamp(10px, 2vw, 12px);
  padding-top: clamp(10px, 2vw, 12px);
  border-top: 1px solid color-mix(in srgb, var(--icon) 20%, transparent);
  text-align: center;
  color: var(--icon);
  font-size: clamp(11px, 2vw, 13px);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}
.notif-footer:hover { text-decoration: underline; opacity: 0.8; }

/* ─── PROFILE DROPDOWN ──────────────────────────────────── */
.profile-dropdown {
  width: min(90vw, 260px);
  background: var(--header-grad);
  border-radius: clamp(10px, 2vw, 12px);
  padding: clamp(6px, 1vw, 8px);
  box-shadow: 0 12px 40px color-mix(in srgb, var(--icon) 30%, transparent);
  border: 1px solid color-mix(in srgb, var(--icon) 30%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.profile-premium {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 10px);
  padding: clamp(6px, 1vw, 8px) clamp(10px, 1.5vw, 12px);
  background: linear-gradient(90deg, color-mix(in srgb, var(--icon) 20%, transparent), transparent);
  border-radius: clamp(6px, 1vw, 8px);
  margin-bottom: clamp(6px, 1vw, 8px);
  cursor: default;
}
.profile-premium-title {
  color: #FFD700;
  font-weight: 700;
  font-size: clamp(11px, 1.8vw, 13px);
  display: block;
}
.profile-premium-sub {
  color: #ccc;
  font-size: clamp(9px, 1.5vw, 11px);
  display: block;
}

.profile-divider {
  height: 1px;
  background: color-mix(in srgb, var(--icon) 25%, transparent);
  margin: clamp(4px, 1vw, 6px) 0;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 10px);
  padding: clamp(8px, 1.5vw, 10px) clamp(10px, 1.5vw, 12px);
  border-radius: clamp(6px, 1vw, 8px);
  color: #fff;
  font-size: clamp(12px, 2vw, 14px);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.profile-menu-item:hover { background: rgba(255,255,255,0.1); }
.profile-menu-icon {
  width: clamp(14px, 2.2vw, 16px);
  height: clamp(14px, 2.2vw, 16px);
  color: var(--icon);
  flex-shrink: 0;
}
.profile-logout { color: #ff7875; }
.profile-logout .profile-menu-icon { color: #ff7875; }
.profile-logout:hover { background: rgba(255,77,79,0.12); }

/* Theme submenu (nested) */
.profile-theme-trigger { justify-content: flex-start; }

.theme-submenu {
  display: none;
  background: rgba(0,0,0,0.3);
  border-radius: clamp(6px, 1vw, 8px);
  margin: 2px clamp(6px, 1.5vw, 10px);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--icon) 20%, transparent);
}
.theme-submenu.open { display: block; }

.theme-submenu-item {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 12px);
  padding: clamp(6px, 1vw, 8px) clamp(10px, 1.5vw, 14px);
  color: var(--icon);
  font-size: clamp(12px, 2vw, 14px);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: clamp(6px, 1vw, 8px);
  background: linear-gradient(90deg, color-mix(in srgb, var(--icon) 0%, transparent), transparent);
}
.theme-submenu-item:hover {
  background: linear-gradient(90deg, color-mix(in srgb, var(--icon) 30%, transparent), transparent);
  font-weight: 700;
}
.theme-check {
  margin-left: auto;
  font-size: 13px;
  color: var(--icon);
  font-weight: 700;
}

/* ════════════════════════════════════════════════════════════
   LAYOUT
   ════════════════════════════════════════════════════════════ */
.page-wrapper {
  background: var(--bg);
  min-height: 100vh;
  padding: clamp(20px,4vw,40px) clamp(16px,4vw,60px);
}

/* ─── HEADINGS ──────────────────────────────────────────── */
.page-title {
  color: var(--icon);
  font-weight: 800;
  font-size: clamp(24px,4vw,32px);
  text-shadow: 0 0 20px color-mix(in srgb, var(--icon) 40%, transparent);
  margin-bottom: 24px;
}
.section-title {
  color: var(--icon);
  font-weight: 700;
  font-size: clamp(20px,3.5vw,26px);
  margin: clamp(30px,5vw,40px) 0 clamp(16px,2.5vw,20px);
}
.sub-title {
  color: var(--text);
  font-weight: 700;
  font-size: clamp(18px,3vw,22px);
  margin-bottom: clamp(16px,2.5vw,20px);
}

/* ─── GRID ──────────────────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(280px,100%),1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(220px,100%),1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fill, minmax(min(180px,100%),1fr)); }

/* ─── INFO CARDS ROW (Deposit / Minting Wallet / Total Balance) ─
   Matches React: xs=24 sm=12 md=8 lg=8
   ≥ 768px  → 3 columns
   576–767px → 2 columns
   < 576px  → 1 column
   ──────────────────────────────────────────────────────────── */
#info-cards-row {
  grid-template-columns: repeat(3, 1fr);
}

/* ─── CARD BASE ─────────────────────────────────────────── */
.card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: clamp(12px,2.5vw,16px);
  padding: clamp(16px,3vw,20px);
  color: var(--text);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.card:hover { transform: translateY(-4px) scale(1.01); }

.card-shadow { box-shadow: 0 0 20px color-mix(in srgb, var(--icon) 10%, transparent), 0 4px 6px rgba(0,0,0,0.25); }

/* ─── MINTING RITUAL CARD ───────────────────────────────── */
.ritual-card {
  background: var(--card-grad);
  border-radius: clamp(16px,3vw,20px);
  padding: clamp(16px,3vw,24px);
  box-shadow: var(--card-shadow);
  border: none;
  margin-bottom: clamp(20px,3vw,30px);
}

/* ─── INFO CARD ─────────────────────────────────────────── */
.info-card-title {
  color: var(--icon);
  font-weight: 600;
  font-size: clamp(16px,2.5vw,18px);
  margin-bottom: 4px;
}
.info-card-addr {
  color: #888;
  font-size: clamp(11px,1.8vw,12px);
  display: block;
  margin-bottom: 10px;
}
.divider { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: clamp(8px,1.5vw,10px) 0; }
.balance-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.balance-value {
  font-weight: 700;
  font-size: clamp(20px,3.5vw,24px);
  display: flex;
  align-items: center;
  gap: 6px;
}
.balance-suffix { color: #888; font-size: clamp(14px,2.2vw,16px); }
.balance-icon { color: var(--icon); font-size: clamp(18px,3vw,20px); }

/* SOL balance color classes */
.sol-low    { color: #ff4d4f; text-shadow: 0 0 10px rgba(255,77,79,0.5); }
.sol-medium { color: #faad14; text-shadow: 0 0 10px rgba(250,173,20,0.5); }
.sol-good   { color: #52c41a; text-shadow: 0 0 10px rgba(82,196,26,0.5); }

/* Deposit Address legends */
.legends { display: flex; flex-direction: column; gap: 3px; }
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-dot {
  width: clamp(5px,1vw,6px);
  height: clamp(5px,1vw,6px);
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-text { font-size: clamp(8px,1.5vw,9px); font-weight: 600; white-space: nowrap; line-height: 1; }

/* ─── MINTING STATUS ────────────────────────────────────── */
.status-label { color: #ccc; font-size: clamp(13px,2vw,15px); }
.tag {
  display: inline-block;
  border-radius: clamp(8px,2vw,12px);
  font-weight: 600;
  padding: 2px 10px;
  font-size: clamp(11px,1.8vw,13px);
  margin-left: clamp(4px,1vw,8px);
}
.tag-gold    { background: #ffd591; color: #7c4a03; }
.tag-green   { background: #b7eb8f; color: #135200; }

/* ─── WALLET CARDS ──────────────────────────────────────── */
/* Responsive: 4 cols → 3 → 2 → 1  (matches React xs=24 sm=12 md=8 lg=6) */
#wallets-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, 1fr);
}

.wallet-card {
  cursor: pointer;
  border-radius: clamp(12px,2.5vw,16px);
  padding: clamp(12px,2.5vw,16px) clamp(16px,3vw,20px);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
  will-change: transform;
  transform: translateZ(0);
  box-shadow: 0 0 10px color-mix(in srgb, var(--icon) 15%, transparent);
}
.wallet-card.selected {
  border: 2px solid var(--icon);
  background: color-mix(in srgb, var(--icon) 8%, transparent);
  box-shadow: 0 0 15px var(--icon), 0 0 5px var(--icon);
}
.wallet-card:hover { transform: translateY(-5px) scale(1.03); }

.wallet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: clamp(8px,1.5vw,10px); }
.wallet-label { color: var(--icon); font-weight: 700; font-size: clamp(14px,2.2vw,16px); }
.wallet-addr  { color: #aaa; font-size: clamp(11px,1.8vw,12px); margin-bottom: 5px; }
.wallet-balance { color: var(--text); font-weight: 600; display: block; margin-bottom: 5px; font-size: clamp(13px,2vw,15px); }
.wallet-limit   { color: #ccc; font-size: clamp(11px,1.8vw,12px); display: block; margin-bottom: clamp(8px,1.5vw,10px); }

/* ─── PROGRESS BAR ──────────────────────────────────────── */
.progress-bar-bg { background: rgba(255,255,255,0.1); border-radius: 4px; height: 6px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--icon); border-radius: 4px; transition: width 0.5s ease; }

/* ─── REDEEM BUTTON ─────────────────────────────────────── */
.btn-redeem {
  display: inline-block;
  background: #ccc;
  border: none;
  color: #fff;
  font-weight: 700;
  padding: 0 clamp(24px,4vw,40px);
  height: clamp(46px,6vw,50px);
  border-radius: clamp(24px,4vw,30px);
  font-size: clamp(14px,2vw,16px);
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: clamp(46px,6vw,50px);
  min-height: 44px;
  touch-action: manipulation;
}
.btn-redeem.active {
  background: linear-gradient(90deg, var(--icon), #ffa500);
  color: #000;
  box-shadow: 0 0 25px color-mix(in srgb, var(--icon) 50%, transparent);
}
.btn-redeem:hover:not(:disabled) { transform: scale(1.03); }
.redeem-wrap { text-align: center; margin-top: clamp(30px,5vw,40px); }

/* ─── SUMMARY CARDS (SmartContracts / TokensLog) ────────── */
/* Responsive: 5 cols → 3 → 2 → 1 (matches React xl flex 1-1-0, lg=8, sm=12) */
#sc-summary-cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(5, 1fr);
  margin-bottom: clamp(30px,4vw,40px);
}

.summary-card {
  border-radius: clamp(12px,2.5vw,16px);
  padding: clamp(16px,3vw,20px);
  background: linear-gradient(135deg, color-mix(in srgb, var(--icon) 12%, transparent), rgba(255,255,255,0.05));
  border: 2px solid color-mix(in srgb, var(--icon) 20%, transparent);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
  will-change: transform;
  transform: translateZ(0);
}
.summary-card:hover { transform: translateY(-5px) scale(1.05); }
.summary-card.active-filter {
  border-color: color-mix(in srgb, var(--icon) 40%, transparent);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--icon) 25%, transparent), 0 0 0 2px var(--icon);
}
.summary-card-glow {
  position: absolute; top: -20px; right: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--icon) 15%, transparent), transparent);
  pointer-events: none;
}
.summary-card-body { display: flex; justify-content: space-between; align-items: flex-start; position: relative; z-index: 1; }
.summary-card-label { color: #999; font-weight: 600; font-size: clamp(11px,1.8vw,13px); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: clamp(6px,1vw,8px); display: block; }
.summary-card-value { color: var(--icon); font-weight: 800; font-size: clamp(26px,4.5vw,32px); text-shadow: 0 2px 8px color-mix(in srgb, var(--icon) 30%, transparent); margin: 0; }
.summary-card-icon-wrap { background: color-mix(in srgb, var(--icon) 20%, transparent); border-radius: clamp(10px,2vw,12px); padding: clamp(10px,2vw,12px); display: flex; align-items: center; justify-content: center; }
.summary-card-icon { font-size: clamp(24px,4vw,28px); color: var(--icon); }
.summary-card-indicator {
  position: absolute; bottom: 0; left: 0;
  height: 3px; width: 0; border-radius: 0 0 16px 16px;
  background: var(--icon);
  transition: width 0.3s ease;
}
.summary-card.active-filter .summary-card-indicator { width: 100%; }

/* TokensLog summary: 3 cols responsive */
#tokens-log-section .grid-3 {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: clamp(30px,4vw,40px);
}

/* ─── CONTRACTS TABLE ───────────────────────────────────── */
.search-filter-row { display: flex; gap: 12px; margin-bottom: clamp(16px,2.5vw,20px); flex-wrap: wrap; align-items: center; justify-content: space-between; }
.search-wrap { flex: 1; min-width: 200px; position: relative; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--icon); font-size: 16px; }
.search-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid color-mix(in srgb, var(--icon) 30%, transparent);
  border-radius: clamp(8px,1.5vw,10px);
  color: #fff;
  padding: 10px 12px 10px 40px;
  font-size: clamp(13px,2vw,15px);
  height: clamp(40px,5.5vw,44px);
  outline: none;
  font-family: inherit;
  min-height: 44px;
  touch-action: manipulation;
}
.search-input::placeholder { color: rgba(255,255,255,0.4); }
.search-input:focus { border-color: var(--icon); }

.filter-dropdown { position: relative; }
.filter-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid #444;
  color: var(--text);
  border-radius: clamp(8px,1.5vw,10px);
  padding: 0 20px;
  height: clamp(40px,5.5vw,44px);
  cursor: pointer;
  font-size: clamp(13px,2vw,15px);
  display: flex; align-items: center; gap: 8px;
  font-family: inherit;
  min-height: 44px;
}
.filter-btn:hover { border-color: var(--icon); color: var(--icon); }
.dropdown-menu {
  display: none;
  position: absolute; right: 0; top: calc(100% + 4px);
  background: #1a1a2e; border: 1px solid #444;
  border-radius: 8px; overflow: hidden; z-index: 50; min-width: 140px;
}
.dropdown-menu.open { display: block; }
.dropdown-item { padding: 10px 16px; color: #ddd; cursor: pointer; font-size: 14px; min-height: 44px; display: flex; align-items: center; }
.dropdown-item:hover { background: rgba(255,255,255,0.1); color: var(--icon); }

.table-card {
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; min-width: 600px; }
.table-wrap { overflow-x: auto; }
thead tr { background: var(--header-grad); }
thead th { color: var(--text); font-weight: 600; padding: 14px 16px; text-align: left; font-size: 13px; letter-spacing: 0.8px; border-bottom: 1px solid rgba(255,255,255,0.1); }
tbody tr { background: transparent; cursor: pointer; transition: background 0.2s ease; }
tbody tr:hover { background: rgba(255,255,255,0.05); }
tbody td { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 13px; color: #aaa; }
.td-amount { color: var(--icon); font-weight: 600; }

.status-tag {
  display: inline-block; border-radius: 12px; padding: 2px 10px;
  font-weight: 600; font-size: 12px;
}
.status-active    { background: #e6f7ff; color: #096dd9; }
.status-pending   { background: #fffbe6; color: #7c5200; }
.status-completed { background: #e6f4ff; color: #0958d9; }
.status-disputed  { background: #fff1f0; color: #cf1322; }
.status-cancelled { background: #fafafa; color: #595959; }
.status-default   { background: #f0f0f0; color: #595959; }

.btn-link { background: none; border: none; color: var(--icon); font-weight: 600; cursor: pointer; padding: 0; font-size: 13px; min-height: 44px; }
.btn-link:hover { text-decoration: underline; }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 16px; background: var(--header-grad); border-top: 1px solid rgba(255,255,255,0.1); flex-wrap: wrap; border-radius: 0 0 16px 16px; }
.page-btn {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: var(--text); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px;
  min-height: 44px; min-width: 44px;
}
.page-btn:hover, .page-btn.current { background: var(--icon); color: #000; border-color: var(--icon); }
.page-info { color: rgba(255,255,255,0.6); font-size: 12px; }

/* ─── TOKENS LOG BURN CARDS ─────────────────────────────── */
/* Burn cards: 4 cols → 3 → 2 → 1 (matches React xs=24 sm=12 md=8 lg=6) */
#tokens-log-section .grid-4 {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, 1fr);
}

.burn-card {
  border-radius: clamp(12px,2.5vw,16px);
  padding: clamp(14px,2.5vw,16px);
  border: 1px solid color-mix(in srgb, var(--icon) 30%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--icon) 7%, transparent), rgba(255,255,255,0.03));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--icon) 12%, transparent);
  position: relative; overflow: hidden; height: 100%;
  transition: transform 0.25s ease;
  will-change: transform;
}
.burn-card:hover { transform: translateY(-5px) scale(1.03); }
.burn-status-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; position: relative; z-index: 1; }
.burn-status-icon { border-radius: 6px; padding: 4px; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.burn-amount-box {
  background: linear-gradient(135deg, color-mix(in srgb, var(--icon) 15%, transparent), color-mix(in srgb, var(--icon) 8%, transparent));
  border-radius: clamp(8px,1.5vw,10px);
  padding: clamp(12px,2vw,14px) clamp(10px,1.8vw,12px);
  margin-bottom: clamp(8px,1.5vw,10px);
  border: 1px solid color-mix(in srgb, var(--icon) 25%, transparent);
  text-align: center; position: relative; z-index: 1;
}
.burn-fire { font-size: clamp(18px,3vw,20px); color: var(--icon); display: block; margin-bottom: clamp(4px,1vw,6px); }
.burn-amount-value { color: var(--icon); font-weight: 900; font-size: clamp(20px,3.5vw,24px); text-shadow: 0 2px 12px color-mix(in srgb, var(--icon) 50%, transparent); }
.burn-amount-label { color: #aaa; font-size: clamp(8px,1.4vw,9px); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; display: block; margin-top: 3px; }
.burn-address-box {
  margin-bottom: 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--icon) 15%, transparent), rgba(255,255,255,0.03));
  border-radius: 10px; padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--icon) 30%, transparent);
  display: flex; align-items: center; justify-content: center; gap: 8px; position: relative; z-index: 1;
}
.burn-address-link { color: var(--icon); font-weight: 600; font-size: 11px; font-family: monospace; letter-spacing: 0.5px; display: flex; align-items: center; gap: 4px; }
.burn-time { display: flex; align-items: center; gap: 6px; justify-content: center; background: rgba(0,0,0,0.2); border-radius: 6px; padding: 6px 10px; }
.burn-time-text { color: #888; font-size: 11px; font-weight: 500; }
.burn-empty { border-radius: clamp(12px,2.5vw,16px); background: rgba(255,255,255,0.02); border: 1px dashed color-mix(in srgb, var(--icon) 30%, transparent); text-align: center; padding: clamp(40px,8vw,60px) clamp(16px,3vw,20px); }

/* ─── MODAL ─────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(10px);
  z-index: 1000; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: rgba(20,20,20,0.95);
  border: 1px solid color-mix(in srgb, var(--icon) 50%, transparent);
  border-radius: 15px; max-width: 560px; width: 90%;
  overflow: hidden;
  animation: fadeIn 0.25s ease;
}
.modal-box.wide { max-width: 800px; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-header {
  background: var(--header-grad);
  border-bottom: 1px solid color-mix(in srgb, var(--icon) 30%, transparent);
  padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { color: #fff; font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.modal-body { background: var(--bg); padding: 24px; max-height: 65vh; overflow-y: auto; }
.modal-footer { background: var(--bg); padding: 0 0 16px 0; display: flex; justify-content: center; gap: 12px; border-top: 1px solid color-mix(in srgb, var(--icon) 30%, transparent); padding-top: 16px; }
.btn-cancel { padding: 8px 24px; border-radius: 8px; border: 1px solid #444; background: rgba(255,255,255,0.07); color: #fff; cursor: pointer; font-size: 14px; font-family: inherit; min-height: 44px; }
.btn-cancel:hover { border-color: #888; }
.btn-confirm {
  padding: 8px 24px; border-radius: 25px; border: none;
  background: var(--icon); color: #1a1a2e;
  font-weight: 600; cursor: pointer; font-size: 14px;
  transition: opacity 0.2s;
  font-family: inherit;
  min-height: 44px;
}
.btn-confirm:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-confirm:not(:disabled):hover { opacity: 0.88; }
.btn-close-modal {
  background: linear-gradient(90deg, var(--icon), #ff6b6b);
  border: none; color: #fff; font-weight: 600;
  border-radius: 25px; padding: 0 40px; height: 48px;
  cursor: pointer; font-size: 15px;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
  min-height: 44px;
}
.btn-close-modal:hover { transform: scale(1.05); }

/* Redeem modal content */
.redeem-stat-title { color: var(--icon); font-weight: 700; font-size: 18px; display: block; margin-bottom: 4px; }
.redeem-total-val { color: var(--text); font-size: 42px; font-weight: 800; display: flex; align-items: center; gap: 6px; justify-content: center; }
.redeem-note { color: #ccc; display: block; margin-top: 20px; font-size: 14px; }
.tag-zero { background: #ff4d4f; color: #fff; margin-top: 15px; display: inline-block; font-size: 14px; padding: 5px 10px; border-radius: 6px; }

/* Contract Detail Modal */
.status-header {
  border-radius: 16px; padding: 24px; margin-bottom: 24px;
  position: relative; overflow: hidden;
}
.status-header-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events: none;
}
.status-header-content { position: relative; z-index: 1; }
.status-header-label { color: rgba(255,255,255,0.9); font-size: 14px; font-weight: 600; display: block; margin-bottom: 8px; }
.status-header-row { display: flex; align-items: center; gap: 12px; }
.status-icon { font-size: 32px; }
.status-text { color: #fff; font-weight: 800; font-size: 28px; }
.modal-section-title { color: var(--icon); font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.modal-divider { border: none; border-top: 1px solid color-mix(in srgb, var(--icon) 30%, transparent); margin: 24px 0; }
.info-section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.info-section-item {
  background: linear-gradient(135deg, color-mix(in srgb, var(--icon) 15%, transparent), rgba(255,255,255,0.03));
  border-radius: 12px; padding: 16px;
  border: 1px solid color-mix(in srgb, var(--icon) 30%, transparent);
  position: relative; overflow: hidden;
}
.info-section-item.full { grid-column: 1 / -1; }
.info-section-label { color: #aaa; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.info-section-label svg, .info-section-label .ico { color: var(--icon); font-size: 16px; }
.info-section-value { color: var(--text); font-weight: 700; font-size: 16px; word-break: break-all; display: block; }
.info-section-link { color: var(--icon); font-weight: 600; font-size: 14px; word-break: break-all; display: flex; align-items: center; gap: 4px; }
.amount-stat-box {
  background: linear-gradient(135deg, color-mix(in srgb, var(--icon) 20%, transparent), rgba(255,255,255,0.05));
  border-radius: 12px; padding: 20px;
  border: 2px solid color-mix(in srgb, var(--icon) 40%, transparent);
  text-align: center; margin-bottom: 12px;
}
.amount-stat-label { color: #aaa; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: 8px; }
.amount-stat-value { color: var(--icon); font-weight: 800; font-size: 36px; text-shadow: 0 2px 8px color-mix(in srgb, var(--icon) 40%, transparent); }
.amount-stat-suffix { color: #aaa; font-size: 18px; margin-left: 6px; }
.timeline { list-style: none; padding-left: 0; }
.timeline-item { display: flex; gap: 12px; margin-bottom: 12px; }
.timeline-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--icon); flex-shrink: 0; margin-top: 4px;
}
.timeline-body {
  background: rgba(255,255,255,0.03); border-radius: 8px; padding: 12px;
  border: 1px solid rgba(255,255,255,0.08); flex: 1;
}
.timeline-body.first { background: color-mix(in srgb, var(--icon) 15%, transparent); border-color: color-mix(in srgb, var(--icon) 40%, transparent); }
.timeline-memo { color: var(--text); font-size: 14px; margin-bottom: 4px; }
.timeline-date { color: #888; font-size: 12px; }

/* ─── SPINNER ────────────────────────────────────────────── */
.spinner-wrap { min-height: 85vh; display: flex; justify-content: center; align-items: center; }
.spinner { width: 48px; height: 48px; border: 5px solid rgba(255,255,255,0.1); border-top-color: var(--icon); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── TOAST MESSAGES ────────────────────────────────────── */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 20px; border-radius: 8px; font-size: 14px;
  color: #fff; max-width: 360px; animation: slideIn 0.3s ease;
  display: flex; align-items: center; gap: 10px; cursor: pointer;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast-success { background: #52c41a; }
.toast-error   { background: #ff4d4f; }
.toast-warning { background: #faad14; color: #000; }
.toast-info    { background: #1890ff; }

/* ─── MISC ──────────────────────────────────────────────── */
.ico { display: inline-flex; align-items: center; vertical-align: middle; }
.loading-row td { text-align: center; padding: 40px; color: #888; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ════════════════════════════════════════════════════════════ */

/* ── Large tablets & small desktops (≤ 1200px) ── */
@media (max-width: 1200px) {
  #sc-summary-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Tablets (≤ 992px) ── */
@media (max-width: 992px) {
  #wallets-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  #sc-summary-cards {
    grid-template-columns: repeat(3, 1fr);
  }
  #tokens-log-section .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(auto-fill, minmax(min(240px,100%), 1fr));
  }
  /* info cards stay 3-col down to 768px */
  #info-cards-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Small tablets (≤ 768px) ── */
@media (max-width: 768px) {
  body { font-size: 14px; }

  .page-wrapper {
    padding: clamp(16px, 4vw, 24px) clamp(12px, 3vw, 20px);
  }

  /* info cards: sm=12 → 2 columns */
  #info-cards-row {
    grid-template-columns: repeat(2, 1fr);
  }

  #wallets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  #sc-summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  #tokens-log-section .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  #tokens-log-section .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .header-bar {
    height: clamp(60px, 10vw, 72px);
  }

  .modal-box,
  .modal-box.wide {
    max-width: calc(100vw - 32px);
    margin: 16px;
  }

  .info-section-grid { grid-template-columns: 1fr; }
  .info-section-item.full { grid-column: 1; }
}

/* ── Mobile (≤ 576px) ── */
@media (max-width: 576px) {
  body { font-size: 13px; }

  .page-wrapper {
    padding: 16px 12px;
  }

  /* info cards: xs=24 → 1 column at true mobile */
  #info-cards-row {
    grid-template-columns: 1fr;
  }

  #wallets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  #sc-summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  #tokens-log-section .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  #tokens-log-section .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: clamp(18px, 4vw, 22px);
  }
  .page-title {
    font-size: clamp(20px, 5vw, 26px);
  }

  .redeem-total-val { font-size: 32px; }

  .modal-body { padding: 16px; }
  .modal-footer { flex-direction: column; align-items: center; }
}

/* ── Small phones (≤ 480px) ── */
@media (max-width: 480px) {
  #wallets-grid {
    grid-template-columns: 1fr;
  }
  #sc-summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  #tokens-log-section .grid-3 {
    grid-template-columns: 1fr;
  }
  #tokens-log-section .grid-4 {
    grid-template-columns: 1fr 1fr;
  }

  .header-tagline { display: none; }

  .modal-box,
  .modal-box.wide {
    max-width: calc(100vw - 24px);
    margin: 12px;
  }
}

/* ── Very small phones (≤ 360px) ── */
@media (max-width: 360px) {
  body { font-size: 12px; }
  #info-cards-row { grid-template-columns: 1fr; }
  #wallets-grid { grid-template-columns: 1fr; }
  #sc-summary-cards { grid-template-columns: 1fr 1fr; }
  #tokens-log-section .grid-4 { grid-template-columns: 1fr; }
  .page-wrapper { padding: 12px; }
  .page-title { font-size: 18px; }
}

/* ── Touch device hover optimisation ── */
@media (hover: none) and (pointer: coarse) {
  .card:hover,
  .wallet-card:hover,
  .summary-card:hover,
  .burn-card:hover { transform: none; }

  .btn-redeem,
  .btn-cancel,
  .btn-confirm,
  .btn-close-modal,
  .filter-btn,
  .page-btn {
    min-height: 48px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

/* ── Landscape phones ── */
@media (max-width: 896px) and (orientation: landscape) {
  .page-wrapper { min-height: auto; padding: 12px; }
  .modal-body { max-height: 70vh; }
}
