/* ============================================
   ETHER BREX - MODERN INVESTMENT PLATFORM CSS
   Light Mode Default | Dark Mode Toggle

   HOW THEMING WORKS:
   JS sets CSS vars as INLINE STYLES on <html> via
   element.style.setProperty(). Inline styles beat
   every external stylesheet (apps.css, dashlite.css).
   html[data-theme="dark"] handles component-specific
   overrides that can't use CSS vars alone.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* ============================================
   LIGHT THEME (DEFAULT)
   ============================================ */
:root {
  --primary: #0EA5E9;
  --primary-dark: #0284C7;
  --primary-darker: #0369A1;
  --primary-glow: rgba(14, 165, 233, 0.18);
  --accent: #059669;
  --accent-glow: rgba(5, 150, 105, 0.15);
  --danger: #DC2626;
  --warning: #D97706;

  /* Light backgrounds */
  --bg-base: #F1F5F9;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-elevated: #F8FAFC;
  --bg-hover: #EFF6FF;

  /* Light borders */
  --border: rgba(15, 23, 42, 0.09);
  --border-bright: rgba(14, 165, 233, 0.35);

  /* Light text */
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;

  /* Shadows (lighter for light mode) */
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.09);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.11);
  --shadow-glow: 0 0 24px rgba(14, 165, 233, 0.12);

  --sidebar-width: 280px;
  --header-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ============================================
   DARK THEME OVERRIDE
   ============================================ */
html[data-theme="dark"] {
  --bg-base: #060D1A;
  --bg-surface: #0B1628;
  --bg-card: #0F1E35;
  --bg-elevated: #142540;
  --bg-hover: #192D4D;

  --border: rgba(14, 165, 233, 0.12);
  --border-bright: rgba(14, 165, 233, 0.3);

  --text-primary: #F0F8FF;
  --text-secondary: #94A3B8;
  --text-muted: #4A6280;

  --accent: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.45);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.55);
}

/* ============================================
   BASE RESET
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  background: var(--bg-base) !important;
  color: var(--text-primary) !important;
  color-scheme: light;
}
html[data-theme="dark"] {
  color-scheme: dark;
  /* Direct overrides for Chrome mobile — vars alone don't always repaint */
  background-color: #060D1A !important;
  color: #F0F8FF !important;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-base) !important;
  background-color: var(--bg-base) !important;
  color: var(--text-primary) !important;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
html[data-theme="dark"] body {
  background: #060D1A !important;
  background-color: #060D1A !important;
  color: #F0F8FF !important;
}

/* Smooth theme transitions on all key elements */
body, .eb-sidebar, .eb-header, .eb-card, .eb-stat-card,
.eb-dropdown, .eb-nav-item, .eb-table tbody tr,
.eb-form-control, .eb-summary, .eb-balance-widget,
.eb-auth-bg, .eb-auth-form-side, .eb-auth-side,
.eb-auth-box, .eb-referral, .eb-content, .eb-footer {
  transition: background-color 0.2s ease, background 0.2s ease,
              color 0.2s ease, border-color 0.2s ease;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }

/* ============================================
   LAYOUT
   ============================================ */
.eb-layout { display: flex; min-height: 100vh; }

.eb-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================
   HEADER
   ============================================ */
.eb-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .eb-header {
  background: rgba(11, 22, 40, 0.96);
}

.eb-header-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.eb-header-toggle:hover { background: var(--bg-elevated); }

.eb-header-logo-mobile { display: none; }
.eb-header-logo-mobile img { height: 34px; width: auto; }

.eb-header-spacer { flex: 1; }

.eb-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- THEME TOGGLE BUTTON ---- */
.eb-theme-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  transition: all .2s;
  flex-shrink: 0;
  line-height: 1;
}
.eb-theme-toggle:hover {
  border-color: var(--border-bright);
  background: var(--bg-hover);
  transform: scale(1.05);
}

/* ---- USER MENU ---- */
.eb-user-menu { position: relative; }

.eb-user-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 40px;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.eb-user-trigger:hover {
  border-color: var(--border-bright);
  background: var(--bg-hover);
}

.eb-user-avatar {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: white;
  flex-shrink: 0;
}

.eb-user-info { text-align: left; }

.eb-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  line-height: 1.2;
}

.eb-user-badge {
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
  display: block;
  letter-spacing: .3px;
}

.eb-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  display: none;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.eb-dropdown.open { display: block; }

.eb-dropdown-header {
  padding: 14px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.eb-dropdown-balance {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 3px;
}

/* Balance in dropdown — smaller, tabular */
.eb-dropdown-amount {
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.3px;
}

.eb-dropdown-list { list-style: none; padding: 6px 0; }

.eb-dropdown-list li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
  transition: all .15s;
}
.eb-dropdown-list li a:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.eb-dropdown-divider { height: 1px; background: var(--border); margin: 3px 0; }

.eb-logout-btn { color: var(--danger) !important; }

/* ============================================
   SIDEBAR
   ============================================ */
.eb-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform .3s ease;
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .eb-sidebar {
  background: var(--bg-surface);
  box-shadow: none;
}

.eb-sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.eb-sidebar-logo img { height: 40px; width: auto; }
.eb-sidebar-logo a { display: inline-flex; align-items: center; text-decoration: none; }

/* Balance Widget in Sidebar */
.eb-balance-widget {
  margin: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}

html[data-theme="dark"] .eb-balance-widget {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--border-bright);
}

.eb-balance-widget::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  filter: blur(16px);
}

.eb-balance-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 5px;
}

html[data-theme="dark"] .eb-balance-label { color: var(--text-muted); }

/* ---- BALANCE AMOUNT — Professional, Compact ---- */
.eb-balance-amount {
  font-family: 'DM Sans', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.4px;
}

html[data-theme="dark"] .eb-balance-amount { color: var(--text-primary); }

.eb-balance-amount small {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  margin-left: 3px;
}

html[data-theme="dark"] .eb-balance-amount small { color: var(--text-secondary); }

.eb-balance-profit {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
}

html[data-theme="dark"] .eb-balance-profit { color: var(--accent); }

.eb-balance-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 12px;
}

/* Sidebar nav */
.eb-nav { padding: 6px 0; flex: 1; }

.eb-nav-section {
  padding: 14px 16px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.eb-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
}

.eb-nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.eb-nav-item.active {
  background: rgba(14,165,233,0.1);
  color: var(--primary);
  font-weight: 600;
  border-left: 2px solid var(--primary);
  margin-left: 6px;
  padding-left: 12px;
}

.eb-nav-icon { width: 17px; height: 17px; flex-shrink: 0; opacity: .75; }
.eb-nav-item.active .eb-nav-icon { opacity: 1; }

.eb-sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border);
}
.eb-sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: none;
  padding: 5px 0;
  transition: color .2s;
}
.eb-sidebar-footer a:hover { color: var(--text-secondary); }

/* ============================================
   CONTENT AREA
   ============================================ */
.eb-content { flex: 1; padding: 26px; }

.eb-page-header { margin-bottom: 24px; }

.eb-page-subtitle {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary);
  margin-bottom: 5px;
}

.eb-page-title {
  font-family: 'Syne', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.eb-page-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 3px;
}

/* ============================================
   STAT CARDS
   ============================================ */
.eb-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.eb-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  box-shadow: var(--shadow-sm);
}

.eb-stat-card:hover {
  border-color: var(--border-bright);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.eb-stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 70px; height: 70px;
  border-radius: 50%;
  filter: blur(28px);
  opacity: .2;
}

.eb-stat-card.blue::after { background: var(--primary); }
.eb-stat-card.green::after { background: var(--accent); }
.eb-stat-card.orange::after { background: var(--warning); }

.eb-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.eb-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
}

.eb-stat-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.eb-stat-icon.blue  { background: rgba(14,165,233,0.12); }
.eb-stat-icon.green { background: rgba(5,150,105,0.12); }
.eb-stat-icon.orange{ background: rgba(217,119,6,0.12); }

html[data-theme="dark"] .eb-stat-icon.green { background: rgba(16,185,129,0.15); }

/* ---- STAT VALUE — compact, financial ---- */
.eb-stat-value {
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.4px;
}

.eb-stat-value span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.eb-stat-footer {
  display: flex;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.eb-stat-meta { flex: 1; }

.eb-stat-meta-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.eb-stat-meta-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.eb-stat-note {
  padding-top: 9px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}

/* ============================================
   CARDS
   ============================================ */
.eb-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.eb-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eb-card-title {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.eb-card-body { padding: 20px; }

/* ============================================
   TABLE
   ============================================ */
.eb-table-wrap { overflow-x: auto; }

.eb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.eb-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.eb-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}

.eb-table tbody tr:last-child { border-bottom: none; }
.eb-table tbody tr:hover { background: var(--bg-elevated); }

.eb-table tbody td {
  padding: 13px 14px;
  color: var(--text-secondary);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

.eb-table tbody td:first-child { font-weight: 500; color: var(--text-primary); }

/* ============================================
   BADGES
   ============================================ */
.eb-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
}

.eb-badge.success { background: rgba(5,150,105,0.12);  color: var(--accent); }
.eb-badge.pending { background: rgba(217,119,6,0.12);  color: var(--warning); }
.eb-badge.danger  { background: rgba(220,38,38,0.12);  color: var(--danger); }

html[data-theme="dark"] .eb-badge.success { background: rgba(16,185,129,0.15); color: #10B981; }
html[data-theme="dark"] .eb-badge.pending { background: rgba(245,158,11,0.15); color: #F59E0B; }
html[data-theme="dark"] .eb-badge.danger  { background: rgba(239,68,68,0.15);  color: #EF4444; }

/* ============================================
   BUTTONS
   ============================================ */
.eb-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
}

.eb-btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 3px 12px rgba(14,165,233,0.28);
}
.eb-btn.primary:hover {
  box-shadow: 0 5px 18px rgba(14,165,233,0.4);
  transform: translateY(-1px);
}

.eb-btn.secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.eb-btn.secondary:hover { background: var(--bg-hover); }

.eb-btn.danger {
  background: rgba(220,38,38,0.08);
  color: var(--danger);
  border: 1px solid rgba(220,38,38,0.2);
}
.eb-btn.danger:hover { background: rgba(220,38,38,0.15); }

.eb-btn.block { width: 100%; justify-content: center; }
.eb-btn.lg    { padding: 13px 26px; font-size: 15px; }

.eb-btn-sm {
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-align: center;
  text-decoration: none;
  transition: all .2s;
  border: none;
  cursor: pointer;
}
.eb-btn-sm.primary { background: var(--primary); color: #fff; }
.eb-btn-sm.primary:hover { background: var(--primary-dark); }
.eb-btn-sm.outline { background: transparent; color: var(--primary); border: 1px solid var(--border-bright); }
.eb-btn-sm.outline:hover { background: var(--bg-elevated); }

/* ============================================
   FORMS
   ============================================ */
.eb-form-group { margin-bottom: 16px; }

.eb-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.eb-form-label .req { color: var(--danger); margin-left: 3px; }

.eb-form-control {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.eb-form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.eb-form-control::placeholder { color: var(--text-muted); }

.eb-form-control-wrap { position: relative; }

.eb-form-icon {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  z-index: 1;
}

.eb-form-note { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

.eb-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394A3B8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 15px;
  padding-right: 36px;
}

/* ============================================
   STEP INDICATOR
   ============================================ */
.eb-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 26px;
}

.eb-step {
  width: 30px;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  margin: 0 3px;
  transition: background .3s;
}

.eb-step.active {
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.eb-step.done { background: var(--accent); }

/* ============================================
   PANEL (flow pages: deposit/withdraw/invest)
   ============================================ */
.eb-panel { max-width: 500px; margin: 0 auto; }

.eb-panel-title { text-align: center; margin-bottom: 22px; }

.eb-panel-title h2 {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.eb-panel-title .via { font-size: 13px; color: var(--text-muted); }
.eb-panel-title .via strong { color: var(--primary); }

/* ============================================
   SUMMARY LIST
   ============================================ */
.eb-summary {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 18px;
}

.eb-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}

.eb-summary-item:last-child { border-bottom: none; }

.eb-summary-item.final {
  background: var(--bg-card);
  font-weight: 600;
  border-top: 1px solid var(--border-bright);
}

.eb-summary-label { font-size: 13px; color: var(--text-muted); }

.eb-summary-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* Final summary row — larger but still tasteful */
.eb-summary-item.final .eb-summary-value {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -.3px;
}

/* ============================================
   TABS
   ============================================ */
.eb-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.eb-tab {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all .2s;
  margin-bottom: -1px;
}

.eb-tab:hover { color: var(--text-secondary); }

.eb-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ============================================
   SEARCH BAR
   ============================================ */
.eb-search {
  position: relative;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.eb-search input {
  flex: 1;
  padding: 10px 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  outline: none;
  width: 100%;
}

.eb-search input::placeholder { color: var(--text-muted); }

.eb-search-icon {
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
  flex-shrink: 0;
}

/* ============================================
   ALERTS
   ============================================ */
.eb-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  font-size: 13px;
  animation: fadeIn .3s ease;
}

.eb-alert.success { background: rgba(5,150,105,0.08); border: 1px solid rgba(5,150,105,0.2); color: #065F46; }
.eb-alert.danger  { background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.2); color: #991B1B; }
.eb-alert.warning { background: rgba(217,119,6,0.08); border: 1px solid rgba(217,119,6,0.2); color: #92400E; }
.eb-alert.info    { background: rgba(14,165,233,0.08); border: 1px solid rgba(14,165,233,0.2); color: #0C4A6E; }

html[data-theme="dark"] .eb-alert.success { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.25); color: #6EE7B7; }
html[data-theme="dark"] .eb-alert.danger  { background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.25);  color: #FCA5A5; }
html[data-theme="dark"] .eb-alert.warning { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.25); color: #FCD34D; }
html[data-theme="dark"] .eb-alert.info    { background: rgba(14,165,233,0.1); border-color: rgba(14,165,233,0.25); color: #7DD3FC; }

.eb-alert-close { margin-left: auto; cursor: pointer; opacity: .7; background: none; border: none; color: inherit; font-size: 15px; }
.eb-alert-close:hover { opacity: 1; }

/* ============================================
   FOOTER
   ============================================ */
.eb-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.eb-empty { text-align: center; padding: 44px 20px; color: var(--text-muted); }
.eb-empty-icon { font-size: 36px; margin-bottom: 10px; opacity: .4; }
.eb-empty-text { font-size: 15px; color: var(--text-secondary); margin-bottom: 4px; font-weight: 500; }
.eb-empty-sub  { font-size: 13px; }

/* ============================================
   RESULT PAGE
   ============================================ */
.eb-result {
  text-align: center;
  padding: 40px 20px;
  max-width: 440px;
  margin: 0 auto;
}

.eb-result-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin: 0 auto 18px;
}

.eb-result-icon.success { background: rgba(5,150,105,0.12);  color: var(--accent); border: 2px solid rgba(5,150,105,0.3); }
.eb-result-icon.danger  { background: rgba(220,38,38,0.12); color: var(--danger);  border: 2px solid rgba(220,38,38,0.3); }

html[data-theme="dark"] .eb-result-icon.success { background: rgba(16,185,129,0.15); color: #10B981; border-color: rgba(16,185,129,0.3); }

.eb-result h2 {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.eb-result p { color: var(--text-secondary); font-size: 14px; margin-bottom: 6px; }

.eb-result-id {
  display: inline-block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-family: monospace;
  font-size: 12px;
  color: var(--primary);
  margin: 10px 0 22px;
}

.eb-result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

/* ============================================
   REFERRAL BOX
   ============================================ */
.eb-referral {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 18px;
  box-shadow: var(--shadow-sm);
}

.eb-referral-title {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.eb-referral-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }

.eb-copy-input { display: flex; gap: 8px; }

.eb-copy-input input {
  flex: 1;
  padding: 9px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: monospace;
  outline: none;
}

.eb-copy-btn {
  padding: 9px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.eb-copy-btn:hover { background: var(--bg-hover); }

/* ============================================
   CRYPTO DEPOSIT
   ============================================ */
.eb-crypto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.eb-crypto-opt {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--bg-elevated);
}
.eb-crypto-opt:hover { border-color: var(--border-bright); background: var(--bg-card); }
.eb-crypto-opt.selected { border-color: var(--primary); background: rgba(14,165,233,0.06); }
.eb-crypto-opt img { width: 34px; height: 34px; margin-bottom: 5px; border-radius: 50%; }
.eb-crypto-opt-name { font-size: 12px; font-weight: 600; color: var(--text-secondary); }

.eb-qr-wrap {
  text-align: center;
  margin: 18px 0;
  padding: 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.eb-qr-wrap img { width: 150px; height: 150px; border-radius: 8px; background: white; padding: 4px; }

.eb-address-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.eb-address-copy input {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-family: monospace;
  font-size: 12px;
  outline: none;
}

/* ============================================
   AUTH PAGES (always dark panel on left)
   ============================================ */
.eb-auth-bg {
  min-height: 100vh;
  background: var(--bg-base);
  display: flex;
  align-items: stretch;
  position: relative;
  overflow: hidden;
}

.eb-auth-side {
  width: 45%;
  background: linear-gradient(160deg, #0B1A30 0%, #071020 100%);
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.eb-auth-side::before {
  content: '';
  position: absolute;
  top: 40%; left: -10%;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(14,165,233,0.12) 0%, transparent 70%);
}

.eb-auth-side-content { position: relative; z-index: 1; }

.eb-auth-side-logo { margin-bottom: 44px; }
.eb-auth-side-logo img { height: 44px; width: auto; }

.eb-auth-tagline {
  font-family: 'Syne', sans-serif;
  font-size: 34px;
  font-weight: 800;
  color: #F0F8FF;
  line-height: 1.2;
  margin-bottom: 16px;
}
.eb-auth-tagline span { color: var(--primary); }

.eb-auth-subtitle {
  font-size: 14px;
  color: #94A3B8;
  line-height: 1.7;
  margin-bottom: 36px;
}

.eb-auth-features { list-style: none; display: flex; flex-direction: column; gap: 12px; }

.eb-auth-features li {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 14px;
  color: #94A3B8;
}

.eb-auth-features li::before {
  content: '✓';
  width: 20px; height: 20px;
  background: rgba(16,185,129,0.15);
  color: #10B981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.eb-auth-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 56px;
  overflow-y: auto;
  background: var(--bg-surface);
}

.eb-auth-box { width: 100%; max-width: 420px; }

.eb-auth-box-header { margin-bottom: 28px; }

.eb-auth-box-title {
  font-family: 'Syne', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.eb-auth-box-sub { font-size: 13px; color: var(--text-muted); }

.eb-auth-divider {
  text-align: center;
  margin: 18px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.eb-auth-link {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
}
.eb-auth-link a { color: var(--primary); font-weight: 600; text-decoration: none; }
.eb-auth-link a:hover { text-decoration: underline; }

.eb-checkbox-wrap { display: flex; align-items: flex-start; gap: 9px; }
.eb-checkbox-wrap input[type="checkbox"] { width: 15px; height: 15px; margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; }
.eb-checkbox-wrap label { font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.eb-checkbox-wrap label a { color: var(--primary); text-decoration: none; }

/* ============================================
   SECTION HEADER
   ============================================ */
.eb-section-header { margin: 22px 0 9px; padding-bottom: 9px; border-bottom: 1px solid var(--border); }
.eb-section-header h6 { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .8px; }
.eb-section-header p  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ============================================
   STRENGTH BAR
   ============================================ */
.eb-strength-bar { height: 3px; background: var(--border); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.eb-strength-fill { height: 100%; width: 0; border-radius: 2px; transition: all .3s; }
.eb-strength-fill.weak   { width: 33%; background: var(--danger); }
.eb-strength-fill.medium { width: 66%; background: var(--warning); }
.eb-strength-fill.strong { width: 100%; background: var(--accent); }

/* ============================================
   CONFIRM CARD
   ============================================ */
.eb-confirm-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  text-align: center;
  max-width: 440px;
  margin: 60px auto;
  box-shadow: var(--shadow-md);
}

.eb-confirm-icon {
  width: 60px; height: 60px;
  background: rgba(5,150,105,0.1);
  border: 2px solid rgba(5,150,105,0.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin: 0 auto 18px;
  color: var(--accent);
}

.eb-confirm-title {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.eb-confirm-text {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 22px;
}

/* ============================================
   MARKET TICKER
   ============================================ */
.eb-ticker-bar {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
}

.eb-ticker-inner {
  display: inline-block;
  animation: ticker 30s linear infinite;
  padding: 9px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.eb-ticker-inner span { margin: 0 26px; font-weight: 500; }
.eb-ticker-inner .up   { color: var(--accent); }
.eb-ticker-inner .down { color: var(--danger); }

@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================
   MOBILE OVERLAY
   ============================================ */
.eb-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 45; /* below header at z-index:150 so header buttons stay tappable */
}

/* ============================================
   AUTH PAGE THEME TOGGLE BUTTON
   Works on iOS/Android with safe area support
   ============================================ */
.eb-auth-theme-btn {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 16px));
  right: max(16px, env(safe-area-inset-right, 16px));
  z-index: 9999;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  box-shadow: var(--shadow-sm);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
  padding: 0;
  transition: background .2s, border-color .2s;
}
.eb-auth-theme-btn:hover { border-color: var(--border-bright); }
.eb-whatsapp-float {
  position: fixed;
  bottom: 22px; right: 22px;
  z-index: 999;
  width: 48px; height: 48px;
  background: #25D366;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 22px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37,211,102,0.4);
  transition: transform .2s;
}
.eb-whatsapp-float:hover { transform: scale(1.08); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .eb-auth-side { display: none; }
  .eb-auth-form-side { padding: 40px 24px; }
}

/* ============================================
   MOBILE OVERLAY — must be BELOW header so
   the header buttons remain tappable
   ============================================ */
.eb-mobile-overlay { z-index: 45; } /* below header (50) */

@media (max-width: 768px) {
  .eb-sidebar { transform: translateX(-100%); z-index: 200; }
  .eb-sidebar.open { transform: translateX(0); }
  .eb-mobile-overlay.open { display: block; }
  .eb-main { margin-left: 0; }
  /* Header stays above overlay */
  .eb-header { z-index: 150; }
  .eb-header-toggle { display: flex; align-items: center; }
  .eb-header-logo-mobile { display: block; }
  .eb-content { padding: 14px; }
  .eb-stats-grid { grid-template-columns: 1fr 1fr; }
  .eb-auth-form-side { padding: 22px 16px; }
  .eb-crypto-grid { grid-template-columns: repeat(2, 1fr); }

  /* Theme toggle — bigger touch target on mobile, ALWAYS VISIBLE */
  .eb-theme-toggle,
  .eb-header-theme-hide {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 20px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}

@media (max-width: 480px) {
  .eb-stats-grid { grid-template-columns: 1fr; }
  .eb-user-info { display: none; }
  /* Compact user trigger */
  .eb-user-trigger { padding: 5px 8px 5px 5px; }
}

/* ---- SIDEBAR THEME TOGGLE (shown on mobile via sidebar) ---- */
.eb-sidebar-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.eb-sidebar-theme-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.eb-sidebar-theme-switch {
  position: relative;
  width: 46px;
  height: 26px;
  background: var(--border);
  border-radius: 13px;
  cursor: pointer;
  border: none;
  transition: background .25s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  flex-shrink: 0;
}
.eb-sidebar-theme-switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform .25s;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
html[data-theme="dark"] .eb-sidebar-theme-switch {
  background: var(--primary);
}
html[data-theme="dark"] .eb-sidebar-theme-switch::after {
  transform: translateX(20px);
}

/* ============================================
   PASSWORD VISIBILITY SUPPRESS
   ============================================ */
input[type="password"]::-ms-reveal { display: none; }