/* ═══════════════════════════════════════════════════════════
   DwinPayment v3.0 — main.css
   Typography: Inter (UI) + IBM Plex Mono (data / amounts)
   ═══════════════════════════════════════════════════════════ */

/* Fonts loaded from index.html (Inter, IBM Plex Mono) */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Warm luxury canvas */
  --bg:          #f3efe8;
  --bg2:         #e8e2d8;
  --surface:     rgba(255, 252, 248, 0.92);
  --surface2:    #faf7f2;

  /* Light cards (cream / soft white) */
  --card:        #ffffff;
  --card2:       #faf7f2;
  --card3:       #f3efe8;
  --card-border: rgba(201, 162, 39, 0.22);

  /* Brand — champagne gold + amethyst + playful pop */
  --navy:        #1e1a2e;
  --gold:        #c9a227;
  --gold-light:  #e8d5a3;
  --teal:        #2dd4bf;
  --violet:      #8b5cf6;
  --indigo:      #6366f1;
  --cyan:        #22d3ee;
  --purple:      #a78bfa;
  --fun:         #ff6b9d;

  /* Gradients */
  --grad-main:   linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #2dd4bf 100%);
  --grad-gold:   linear-gradient(135deg, #b8860b, #e8c468 50%, #f5e6b8);
  --grad-green:  linear-gradient(135deg,#10b981,#34d399);
  --grad-red:    linear-gradient(135deg,#ef4444,#f87171);
  --grad-card:   linear-gradient(165deg, #ffffff 0%, #faf7f2 45%, #f5f0e8 100%);
  --grad-shine:  linear-gradient(105deg, transparent 40%, rgba(201,162,39,.12) 50%, transparent 60%);

  /* Status */
  --success:     #34d399;
  --warning:     #fbbf24;
  --danger:      #f87171;
  --info:        #2dd4bf;

  /* Text — high contrast on cream / white surfaces */
  --text:         #141018;
  --text2:        #2c2838;
  --muted:        #454056;
  /* Legacy names (inline styles used these on light cards — must stay dark) */
  --text-on-dark: var(--text);
  --muted-dark:   var(--text2);
  /* True light copy only for dark bars / gradient buttons */
  --text-inverse: #f8f6fc;
  --muted-inverse:#c8c2d4;
  /* Used in module templates (monitor, etc.) */
  --border:       rgba(12, 35, 64, 0.14);
  --dim:          var(--text2);

  /* Layout */
  --sidebar-w:   248px;
  --header-h:    60px;
  --radius:      18px;
  --radius-sm:   10px;
  --radius-lg:   24px;

  /* Shadows — soft gold lift */
  --shadow-sm:   0 2px 12px rgba(30, 26, 46, 0.06), 0 0 0 1px rgba(201, 162, 39, 0.06);
  --shadow:      0 8px 32px rgba(30, 26, 46, 0.1), 0 0 0 1px rgba(201, 162, 39, 0.08);
  --shadow-lg:   0 20px 50px rgba(26, 21, 40, 0.18), 0 0 0 1px rgba(232, 213, 163, 0.12);
  --shadow-card: 0 10px 36px rgba(30, 26, 46, 0.08), 0 0 0 1px rgba(201, 162, 39, 0.14), inset 0 1px 0 rgba(255,255,255,0.9);

  /* Fonts — one clean sans for everything; mono tuned for numbers & addresses */
  --font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  --lh-body:      1.6;
  --lh-snug:      1.4;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: var(--font-body);
  line-height: var(--lh-body);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 100% -20%, rgba(139, 92, 246, 0.08), transparent 50%),
    radial-gradient(ellipse 100% 60% at -10% 100%, rgba(45, 212, 191, 0.07), transparent 45%),
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(201, 162, 39, 0.04), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* Tabular figures: aligned columns for balances, stats, tables */
.stat-value,
.stat-sub,
.stat-change-up,
.stat-change-down,
.header-badge,
.api-key-display,
.dwin-table tbody td,
.data-table td,
.data-table th,
input[type="number"],
.form-input[type="number"] {
  font-variant-numeric: tabular-nums lining-nums;
}

.font-mono,
code, kbd, pre, samp {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
}

/* Module chrome (many views built from JS templates) */
.module-page { max-width: 1200px; margin: 0 auto; }
.module-page .page-title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--navy);
}
.module-page .page-sub {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text2);
  line-height: 1.55;
  margin-top: 4px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.5;
}
.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(12, 35, 64, 0.08);
}
.data-table thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text2);
  background: rgba(30, 26, 46, 0.05);
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(201,162,39,.35), rgba(139,92,246,.35)); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(201,162,39,.55), rgba(139,92,246,.55)); }

/* ── Screen Layers (role/auth/2fa/seed/kyc) ────────────────── */
.screen-layer {
  position: fixed; inset: 0;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 50; overflow-y: auto;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 70% at 50% -10%, rgba(201, 162, 39, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 80%, rgba(139, 92, 246, 0.1), transparent 50%);
}
/* Beat third-party CSS (e.g. utility frameworks) that might set display on generic classes */
.screen-layer:not(.active) { display: none !important; }
.screen-layer.active { display: flex !important; }

/* ── App Shell ─────────────────────────────────────────────── */
#app-shell {
  position: fixed; inset: 0;
  z-index: 100; display: none;
  flex-direction: column;
}
#app-shell.active { display: flex; }

/* ── App Header — glass + gold hairline ────────────────────── */
.app-header {
  height: var(--header-h);
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(201, 162, 39, 0.18);
  display: flex; align-items: center;
  gap: 10px; padding: 0 18px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0; position: relative; z-index: 200;
}
.app-header::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 213, 163, 0.5), transparent);
  pointer-events: none;
}

.hamburger-btn {
  width: 38px; height: 38px;
  background: rgba(201, 162, 39, 0.08); border: none; cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  border-radius: var(--radius-sm); padding: 6px;
  transition: background .25s, transform .2s;
}
.hamburger-btn:hover { background: rgba(139, 92, 246, 0.1); transform: scale(1.04); }
.hamburger-btn span {
  display: block; width: 18px; height: 2px;
  background: linear-gradient(90deg, var(--navy), var(--gold)); border-radius: 2px; transition: .3s;
}

.header-brand { display: flex; align-items: center; gap: 8px; margin-right: 4px; }
.header-logo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.35); }
.header-brand-text {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.125rem; color: var(--navy);
  letter-spacing: -0.01em;
  line-height: var(--lh-snug);
}
.header-brand-text::after {
  content: ''; display: block; height: 2px; width: 36px; margin-top: 2px;
  border-radius: 2px; background: var(--grad-gold);
}

.header-badge {
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 99px;
  font-family: var(--font-mono); text-transform: uppercase;
}
.badge-network { background: rgba(45,212,191,.14); color: #0d9488; }
.badge-polygon { background: rgba(139,92,246,.12); color: #7c3aed; }
.role-tag { background: rgba(201,162,39,.15); color: #9a7b1a; border: 1px solid rgba(201,162,39,.25); }
.role-tag.admin { background: rgba(251,191,36,.15); color: #b45309; border-color: rgba(251,191,36,.3); }

.header-security { display: flex; gap: 6px; margin-left: auto; }
.sec-indicator {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px rgba(52,211,153,.55);
  animation: secPulse 2s ease-in-out infinite;
}
.sec-indicator:nth-child(2) { animation-delay: .4s; background: var(--fun); box-shadow: 0 0 10px rgba(255,107,157,.45); }
.sec-indicator:nth-child(3) { animation-delay: .8s; background: var(--gold); box-shadow: 0 0 10px rgba(201,162,39,.5); }

.header-user {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 6px 12px; border-radius: var(--radius-sm);
  transition: background .25s, box-shadow .25s;
  border: 1px solid transparent;
}
.header-user:hover {
  background: rgba(201, 162, 39, 0.08);
  border-color: rgba(201, 162, 39, 0.2);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.08);
}
.header-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--grad-main);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  box-shadow: 0 0 0 2px rgba(232, 213, 163, 0.35);
}
.header-user-info { display: flex; flex-direction: column; }

/* ── App Body ──────────────────────────────────────────────── */
.app-body {
  display: flex; flex: 1; overflow: hidden;
  position: relative;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  backdrop-filter: blur(12px);
  border-right: 1px solid rgba(201, 162, 39, 0.12);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  flex-shrink: 0;
  transition: transform .35s cubic-bezier(.34, 1.2, .64, 1);
}

.sidebar-header {
  padding: 18px 14px 12px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.1);
}
.sidebar-search {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, rgba(201,162,39,.08), rgba(139,92,246,.06));
  border: 1px solid rgba(201, 162, 39, 0.12);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.sidebar-search input {
  flex: 1; background: none; border: none; outline: none;
  font-family: var(--font-body); font-size: 14px;
  color: var(--text); placeholder-color: var(--muted);
}
.sidebar-search-icon { font-size: 13px; opacity: .5; }

.nav-section { padding: 8px 0; }
.nav-section-title {
  font-family: var(--font-body);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; color: var(--text2);
  padding: 8px 16px 6px; text-transform: uppercase;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; cursor: pointer;
  border-radius: 0; transition: all .28s cubic-bezier(.34, 1.1, .64, 1);
  font-size: 14px; font-weight: 500;
  color: var(--text2); position: relative;
  margin: 2px 10px; border-radius: var(--radius-sm);
  border: 1px solid transparent;
  line-height: var(--lh-snug);
}
.nav-item:hover {
  background: rgba(201, 162, 39, 0.07);
  color: var(--navy);
  transform: translateX(2px);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(139,92,246,.14), rgba(45,212,191,.1));
  color: #5b21b6;
  font-weight: 600;
  border-color: rgba(139, 92, 246, 0.15);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.08);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 62%;
  background: var(--grad-gold);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.5);
}

/* AI Assistant — keep robot visible & celebratory */
.nav-item[data-module="assistant"] {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.08), rgba(139, 92, 246, 0.06));
  border: 1px dashed rgba(255, 107, 157, 0.35);
}
.nav-item[data-module="assistant"]:hover {
  border-style: solid;
  box-shadow: 0 0 20px rgba(255, 107, 157, 0.15);
}
/* Sidebar: icon slot — 3D art comes from icons-3d.css (no solid color tile) */
.sidebar .nav-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background-color: transparent;
  box-shadow: none;
}
.admin-only { display: none; }
.admin-mode .admin-only { display: flex; }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 150;
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  background: transparent;
  position: relative;
}

.module-container {
  display: none; padding: 20px;
  min-height: 100%;
  animation: fadeIn .3s ease;
  font-size: 1rem;
  line-height: var(--lh-body);
}
.module-container.active { display: block; }

/* ── Bottom Tabs ───────────────────────────────────────────── */
.bottom-tabs {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 58px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(201, 162, 39, 0.2);
  z-index: 200;
  box-shadow: 0 -8px 32px rgba(30, 26, 46, 0.08);
}
.bottom-tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; background: none; border: none;
  cursor: pointer; font-family: var(--font-body);
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--text2);
  transition: color .25s, transform .2s; padding: 0;
  line-height: 1.3;
}
.bottom-tab:hover { transform: translateY(-2px); color: var(--navy); }
.bottom-tab.active {
  color: #6d28d9;
  background: linear-gradient(180deg, rgba(139,92,246,.1), transparent);
}
.tab-icon { font-size: 22px; filter: drop-shadow(0 2px 4px rgba(201,162,39,.2)); }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--grad-card);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}
.card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: var(--grad-shine); opacity: 0.6;
}
.card-light {
  background: var(--surface);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  border: 1px solid rgba(201, 162, 39, 0.14);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 16px 20px 12px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
}
.card-title {
  font-family: var(--font-body);
  font-size: 15px; font-weight: 600;
  color: var(--navy);
  line-height: var(--lh-snug);
}
.card-title-light {
  font-family: var(--font-body);
  font-size: 15px; font-weight: 600;
  color: var(--navy);
  line-height: var(--lh-snug);
}
.card-body { padding: 16px 20px; line-height: var(--lh-body); }

/* ── Stat Cards ────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.stat-card {
  background: var(--grad-card);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.violet::before { background: linear-gradient(90deg,var(--violet),var(--cyan)); }
.stat-card.teal::before   { background: linear-gradient(90deg,var(--teal),#38bdf8); }
.stat-card.green::before  { background: linear-gradient(90deg,var(--success),#34d399); }
.stat-card.amber::before  { background: linear-gradient(90deg,var(--warning),#fbbf24); }
.stat-card.red::before    { background: linear-gradient(90deg,var(--danger),#f87171); }

.stat-label {
  font-size: 12px; font-weight: 600;
  color: var(--text2); letter-spacing: .02em;
  text-transform: uppercase; margin-bottom: 6px;
  font-family: var(--font-body);
}
.stat-value {
  font-family: var(--font-body);
  font-size: 24px; font-weight: 600;
  color: var(--navy);
  line-height: 1.25;
  font-variant-numeric: tabular-nums lining-nums;
}
.stat-sub {
  font-size: 13px; color: var(--text2);
  margin-top: 4px; display: flex; align-items: center; gap: 4px;
  line-height: var(--lh-snug);
}
.stat-change-up   { color: var(--success); font-weight: 600; }
.stat-change-down { color: var(--danger); font-weight: 600; }
.stat-icon-wrap {
  position: absolute; right: 16px; top: 16px;
  width: 40px; height: 40px;
  background: rgba(139, 92, 246, 0.1);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; border: none; border-radius: var(--radius-sm);
  cursor: pointer; font-family: var(--font-body);
  font-weight: 600; transition: all .2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad-main); color: #fff;
  padding: 11px 22px; font-size: 14px; font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35), 0 0 0 1px rgba(232, 213, 163, 0.2);
  border-radius: var(--radius-sm);
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 10px 28px rgba(139, 92, 246, 0.42), 0 0 0 1px rgba(232, 213, 163, 0.35);
}
.btn-secondary {
  background: rgba(255, 252, 248, 0.9);
  color: var(--navy);
  padding: 11px 22px; font-size: 14px; font-weight: 600;
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: var(--radius-sm);
}
.btn-secondary:hover {
  background: rgba(201, 162, 39, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
}
.btn-ghost {
  background: rgba(30, 26, 46, 0.05); color: var(--navy);
  padding: 8px 16px; font-size: 14px;
  border: 1px solid rgba(30, 26, 46, 0.12);
}
.btn-ghost:hover { background: rgba(139, 92, 246, 0.08); }
.btn-gold {
  background: var(--grad-gold); color: #3d2e0a;
  padding: 11px 24px; font-size: 14px; font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 6px 22px rgba(184, 134, 11, 0.35), inset 0 1px 0 rgba(255,255,255,0.45);
  border-radius: var(--radius-sm);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(184, 134, 11, 0.4); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; }
.btn-danger {
  background: var(--grad-red); color: #fff;
  padding: 10px 20px; font-size: 14px;
}

/* ── Badges / Chips ────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  padding: 3px 9px; border-radius: 99px;
  font-family: var(--font-body); text-transform: uppercase;
  /* Default: readable on light cards (Bootstrap often sets white text) */
  color: var(--navy);
  background: rgba(30, 26, 46, 0.08);
}
.badge-green  { background: rgba(16,185,129,.15); color: #047857; }
.badge-red    { background: rgba(239,68,68,.15); color: #b91c1c; }
.badge-amber  { background: rgba(245,158,11,.15); color: #b45309; }
.badge-violet { background: rgba(124,58,237,.15); color: #5b21b6; }
.badge-teal   { background: rgba(6,182,212,.15); color: #0e7490; }
.badge-blue   { background: rgba(79,70,229,.15); color: #3730a3; }

/* Bootstrap + app modules use these names — must stay dark-on-tint (never white on cream) */
.badge.badge-primary,
.badge-primary {
  background: rgba(79, 70, 229, 0.16) !important;
  color: #312e81 !important;
}
.badge.badge-success,
.badge-success,
.badge.bg-success {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #047857 !important;
}
.badge.badge-warn,
.badge-warn,
.badge.badge-warning,
.badge-warning {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #92400e !important;
}
.badge.badge-muted,
.badge-muted,
.badge.badge-secondary,
.badge-secondary,
.badge.bg-secondary {
  background: rgba(30, 26, 46, 0.1) !important;
  color: var(--text2) !important;
}
.badge.badge-info,
.badge-info,
.badge.bg-info {
  background: rgba(6, 182, 212, 0.16) !important;
  color: #0e7490 !important;
}
.badge.text-bg-primary,
.badge.text-bg-success,
.badge.text-bg-warning,
.badge.text-bg-secondary,
.badge.text-bg-info {
  background-image: none !important;
}
.badge.text-bg-primary { background-color: rgba(79, 70, 229, 0.16) !important; color: #312e81 !important; }
.badge.text-bg-success { background-color: rgba(16, 185, 129, 0.16) !important; color: #047857 !important; }
.badge.text-bg-warning { background-color: rgba(245, 158, 11, 0.2) !important; color: #92400e !important; }
.badge.text-bg-secondary { background-color: rgba(30, 26, 46, 0.1) !important; color: var(--text2) !important; }
.badge.text-bg-info { background-color: rgba(6, 182, 212, 0.16) !important; color: #0e7490 !important; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text2); margin-bottom: 6px;
  line-height: var(--lh-snug);
}
.form-input {
  width: 100%; padding: 10px 14px;
  background: var(--bg2); border: 1.5px solid rgba(12,35,64,.1);
  border-radius: var(--radius-sm); outline: none;
  font-family: var(--font-body); font-size: 15px; color: var(--text);
  line-height: 1.5;
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus {
  border-color: rgba(201, 162, 39, 0.55);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12), 0 0 0 1px rgba(201, 162, 39, 0.2);
}
.form-input-dark {
  width: 100%; padding: 10px 14px;
  background: var(--bg2); border: 1.5px solid rgba(12, 35, 64, 0.12);
  border-radius: var(--radius-sm); outline: none;
  font-family: var(--font-body); font-size: 15px; color: var(--text);
  line-height: 1.5;
  transition: border-color .2s;
}
.form-input-dark:focus { border-color: var(--teal); }
.form-select {
  width: 100%; padding: 10px 14px;
  background: var(--bg2); border: 1.5px solid rgba(12,35,64,.1);
  border-radius: var(--radius-sm); outline: none;
  font-family: var(--font-body); font-size: 15px; color: var(--text);
  line-height: var(--lh-snug);
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%234a6280'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  background-size: 8px; padding-right: 30px;
}

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.dwin-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
.dwin-table thead th {
  padding: 10px 14px; text-align: left;
  font-family: var(--font-body); font-size: 11px;
  font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text2);
  background: rgba(30, 26, 46, 0.06);
  border-bottom: 1px solid rgba(12, 35, 64, 0.12);
}
.dwin-table tbody td {
  padding: 11px 14px; color: var(--text);
  border-bottom: 1px solid rgba(12, 35, 64, 0.06);
}
.dwin-table tbody tr:hover { background: rgba(139, 92, 246, 0.05); }
.dwin-table tbody tr:last-child td { border-bottom: none; }

/* ── Progress / Charts ─────────────────────────────────────── */
.progress-bar-wrap {
  height: 6px; background: rgba(30, 26, 46, 0.08);
  border-radius: 99px; overflow: hidden;
}
.progress-bar {
  height: 100%; background: var(--grad-main);
  border-radius: 99px; transition: width .8s ease;
}

/* ── Toast ─────────────────────────────────────────────────── */
#dwin-toast-wrap {
  position: fixed; bottom: 70px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.dwin-toast {
  background: linear-gradient(135deg, #ffffff, #faf7f2);
  color: var(--navy);
  border-radius: var(--radius-sm); padding: 14px 20px;
  font-size: 14px; font-weight: 500;
  line-height: var(--lh-snug);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(201, 162, 39, 0.22);
  border-left: 4px solid var(--gold);
  animation: toastIn .35s cubic-bezier(.34, 1.2, .64, 1); max-width: 320px;
}
.dwin-toast.error  { border-left-color: var(--danger); }
.dwin-toast.success{ border-left-color: var(--success); }
.dwin-toast.warn   { border-left-color: var(--warning); }

/* ── User Menu Dropdown ────────────────────────────────────── */
#user-menu-dropdown {
  position: fixed; top: 54px; right: 12px;
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid rgba(12,35,64,.1); box-shadow: var(--shadow-lg);
  min-width: 200px; z-index: 1000; padding: 8px 0;
  display: none;
}
#user-menu-dropdown.open { display: block; animation: fadeIn .2s ease; }
.user-menu-item {
  padding: 10px 16px; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  color: var(--text2); transition: background .15s;
}
.user-menu-item:hover { background: var(--bg2); color: var(--navy); }
.user-menu-divider { height: 1px; background: rgba(12,35,64,.07); margin: 6px 0; }

/* ── Module Header ─────────────────────────────────────────── */
.module-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.module-title {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 600; color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.module-subtitle { font-size: 15px; color: var(--text2); margin-top: 4px; font-weight: 500; line-height: var(--lh-snug); }
.module-actions { display: flex; gap: 8px; }

/* ── Grid Layouts ──────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 16px; }
.flex-row { display: flex; gap: 16px; }
.flex-col { display: flex; flex-direction: column; gap: 16px; }

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeIn   { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
@keyframes slideIn  { from{transform:translateX(-100%)} to{transform:none} }
@keyframes toastIn  { from{opacity:0;transform:translateX(20px)} to{opacity:1;transform:none} }
@keyframes secPulse { 0%,100%{opacity:1} 50%{opacity:.4} }
@keyframes coinFloat{ 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
@keyframes spin     { to{transform:rotate(360deg)} }
@keyframes pulse    { 0%,100%{opacity:1} 50%{opacity:.5} }
@keyframes shimmer  {
  0%{background-position:-200% 0}
  100%{background-position:200% 0}
}

/* ── Skeleton Loader ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,rgba(30,26,46,.06) 25%,rgba(201,162,39,.1) 50%,rgba(30,26,46,.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--radius-sm);
}

/* ── Divider ───────────────────────────────────────────────── */
.divider { height: 1px; background: rgba(12, 35, 64, 0.08); margin: 16px 0; }
.divider-light { height: 1px; background: rgba(12,35,64,.07); margin: 16px 0; }

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 20px; text-align: center;
  color: var(--text2);
}
.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: .85; }
.empty-state-text { font-size: 15px; font-weight: 600; color: var(--navy); line-height: var(--lh-snug); }
.empty-state-sub  { font-size: 14px; color: var(--text2); margin-top: 4px; line-height: var(--lh-body); }

/* ── NFT Marketplace (cards; tabs scoped to #module-nft vs dwin-upgrade .tab-btn) ── */
#module-nft .tabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(12, 35, 64, 0.1);
}
#module-nft .tabs-row .tab-btn {
  padding: 10px 18px !important;
  border: 1px solid rgba(12, 35, 64, 0.12) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--surface) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--text2) !important;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
  font-family: var(--font-body) !important;
}
#module-nft .tabs-row .tab-btn:hover {
  border-color: rgba(139, 92, 246, 0.35) !important;
  color: var(--navy) !important;
  background: rgba(139, 92, 246, 0.06) !important;
}
#module-nft .tabs-row .tab-btn.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(45, 212, 191, 0.08)) !important;
  border-color: rgba(139, 92, 246, 0.35) !important;
  color: #5b21b6 !important;
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.12);
}

/* ── Treasury & PoR tabs (same layout as NFT; teal accent) ── */
#module-treasury .tabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(12, 35, 64, 0.1);
}
#module-treasury .tabs-row .tab-btn {
  padding: 10px 18px !important;
  border: 1px solid rgba(12, 35, 64, 0.12) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--surface) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--text2) !important;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
  font-family: var(--font-body) !important;
}
#module-treasury .tabs-row .tab-btn:hover {
  border-color: rgba(0, 151, 167, 0.35) !important;
  color: var(--navy) !important;
  background: rgba(0, 151, 167, 0.06) !important;
}
#module-treasury .tabs-row .tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 151, 167, 0.12), rgba(45, 212, 191, 0.08)) !important;
  border-color: rgba(0, 151, 167, 0.35) !important;
  color: #0a4a5c !important;
  box-shadow: 0 2px 12px rgba(0, 151, 167, 0.12);
}

.nft-tab-shell .card-body { padding: 20px; }
.nft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.nft-card {
  background: var(--grad-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, border-color .2s;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}
.nft-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(139, 92, 246, 0.35);
}
.nft-img {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(48px, 12vw, 72px);
  line-height: 1;
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.1), rgba(45, 212, 191, 0.07));
  border-bottom: 1px solid rgba(12, 35, 64, 0.06);
}
.nft-info {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.nft-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}
.nft-collection {
  font-size: 13px;
  color: var(--text2);
  font-weight: 500;
}
.nft-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(12, 35, 64, 0.08);
}
.nft-price {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: #0d9488;
  font-variant-numeric: tabular-nums;
}

.nft-collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.nft-collection-card {
  background: var(--grad-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  transition: transform .2s, box-shadow .2s, border-color .2s;
  display: flex;
  flex-direction: column;
}
.nft-collection-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(201, 162, 39, 0.35);
}
.nft-collection-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}
.nft-collection-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(201, 162, 39, 0.12));
  border: 1px solid rgba(201, 162, 39, 0.2);
}
.nft-collection-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
}
.nft-collection-tagline {
  font-size: 12px;
  color: var(--text2);
  margin-top: 4px;
}
.nft-collection-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin: 16px 0 18px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text2);
}
.nft-collection-stats span.val {
  display: block;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: none;
  letter-spacing: 0;
  color: var(--navy);
  margin-top: 4px;
}
.nft-collection-stats span.val.teal { color: #0d9488; }
.nft-collection-stats span.val.green { color: #047857; }

.nft-activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nft-activity-card {
  background: var(--grad-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px 18px;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, border-color .2s;
}
.nft-activity-card:hover {
  box-shadow: var(--shadow);
  border-color: rgba(139, 92, 246, 0.2);
}
.nft-activity-main strong {
  display: block;
  font-size: 15px;
  color: var(--navy);
  font-weight: 700;
}
.nft-activity-meta {
  font-size: 12px;
  color: var(--text2);
  margin-top: 4px;
  font-family: var(--font-mono);
  line-height: 1.4;
}
.nft-activity-side {
  text-align: right;
}
.nft-activity-price {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: #047857;
}
.nft-activity-time {
  font-size: 12px;
  color: var(--text2);
  margin-top: 4px;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    z-index: 160; transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .sidebar-overlay.open { display: block; }
  .bottom-tabs { display: flex; }
  .main-content { padding-bottom: 56px; }
  .module-container { padding: 14px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .module-header { flex-direction: column; align-items: flex-start; }
  .nft-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .nft-collection-grid { grid-template-columns: 1fr; }
  .nft-activity-card {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .nft-activity-side { text-align: left; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .header-brand-text { display: none; }
  .nft-grid { grid-template-columns: 1fr; }
}

/* ── Tailwind/Bootstrap compatibility (DwinPayment overrides) ── */
#app-shell .btn,
.screen-layer .btn,
.auth-form .btn,
.twofa-card .btn,
.seed-card .btn {
  font-family: var(--font-body);
}
#app-shell input.form-input,
.auth-form input.form-input {
  font-family: var(--font-body);
}

/*
 * Sidebar icons (#sidebar): emoji + shadow — wins over legacy dwin-upgrade.css
 * rules like [data-module="…"] .nav-icon { background: linear-gradient(...) }
 * (production often loads only main.css + dwin-upgrade.css, no icons-3d.css).
 */
#sidebar .nav-item[data-module] > .nav-icon {
  font-size: 22px !important;
  line-height: 1 !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  background: none !important;
  background-image: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.45)) !important;
}
#sidebar .nav-item[data-module="assistant"] > .nav-icon {
  filter: drop-shadow(0 2px 6px rgba(201, 162, 39, 0.5))
    drop-shadow(0 0 14px rgba(255, 107, 157, 0.35)) !important;
}
#sidebar .nav-item:hover > .nav-icon,
#sidebar .nav-item.active > .nav-icon {
  box-shadow: none !important;
  transform: scale(1.06) translateY(-1px) !important;
}
