/* ===== AURUM Dashboard — ArbCore-inspired Dark Theme ===== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #10101a;
  --bg-card: #14142a;
  --bg-card-hover: #1a1a35;
  --bg-sidebar: #0d0d18;
  --gold: #d4af37;
  --gold-light: #f0d070;
  --gold-dark: #a07c2e;
  --text-primary: #f0f0f5;
  --text-secondary: #9999b0;
  --text-muted: #66667a;
  --border: rgba(212,175,55,0.15);
  --border-active: rgba(212,175,55,0.4);
  --green: #22c55e;
  --red: #f87171;
  --blue: #60a5fa;
  --accent-green: #22c55e;
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --radius: 14px;
  --radius-sm: 8px;
  --transition: .25s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; max-width: 100vw; overflow-x: hidden; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; }

/* Language — handled by JS i18n */

/* ───── Login Screen ───── */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bg-primary), #0f0f20 60%, #15122a);
  padding: 20px;
}
.login-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 40px 32px; width: 100%; max-width: 400px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.login-logo { display: block; margin: 0 auto 24px; text-align: center; text-decoration: none; transition: opacity .18s, transform .18s; -webkit-tap-highlight-color: transparent; }
.login-logo img { height: 48px; width: auto; display: block; margin: 0 auto; }
.login-logo:hover { opacity: .85; transform: translateY(-1px); }
.login-logo:active { transform: translateY(0); }
.login-tabs { display: flex; gap: 8px; margin-bottom: 24px; }
.login-tab {
  flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 14px; transition: var(--transition);
}
.login-tab.active { background: var(--gold); color: #000; border-color: var(--gold); font-weight: 600; }
.auth-error { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 20px; }

/* ───── Form Fields ───── */
.form-field { margin-bottom: 14px; text-align: left; }
.form-field label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-secondary); color: var(--text-primary); font-size: 14px; outline: none; transition: var(--transition);
}
.form-field input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212,175,55,.15); }
.pass-field { position: relative; }
.pass-field input { padding-right: 44px; }
.pass-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  padding: 6px; line-height: 0; -webkit-tap-highlight-color: transparent;
}
.pass-toggle:active { color: var(--gold); }
.form-row { display: flex; gap: 12px; }
.form-row .form-field { flex: 1; }

/* ───── Buttons ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 24px; border-radius: var(--radius-sm); border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; transition: var(--transition); text-decoration: none;
}
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: #000; }
.btn-gold:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--gold); }
.btn-outline:hover { border-color: var(--gold); background: rgba(212,175,55,.08); }
.btn-sm { padding: 8px 14px; font-size: 12px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ───── App Shell ───── */
.app-shell { display: flex; min-height: 100vh; }

/* ───── Sidebar Overlay ───── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6);
  z-index: 99; opacity: 0; transition: opacity var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.sidebar-overlay.visible { display: block; opacity: 1; }
body.sidebar-open { overflow: hidden; }

/* ───── Sidebar ───── */
.sidebar {
  width: var(--sidebar-w); background: var(--bg-sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100; transition: transform var(--transition);
  -webkit-overflow-scrolling: touch;
  overflow-y: auto; overflow-x: hidden;
}
.sidebar-logo { display: flex; align-items: center; padding: 18px 20px; }
.sidebar-logo-img { height: 36px; width: auto; display: block; }
.logo-icon { font-size: 28px; color: var(--gold); }
.logo-text { font-size: 22px; font-weight: 700; letter-spacing: 3px; color: var(--gold); }
.sidebar-nav { flex: 1 1 auto; padding: 8px 12px; min-height: 0; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm);
  color: var(--text-secondary); text-decoration: none; font-size: 15px; transition: var(--transition);
  margin-bottom: 2px; min-height: 48px;
  -webkit-tap-highlight-color: rgba(212,175,55,.15);
}
.nav-item:hover { background: rgba(212,175,55,.06); color: var(--text-primary); }
.nav-item.active { background: rgba(212,175,55,.12); color: var(--gold); }
.nav-icon { width: 22px; height: 22px; fill: currentColor; flex-shrink: 0; }
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
}
.lang-btn, .logout-btn {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent; color: var(--text-secondary);
  cursor: pointer; font-size: 13px; transition: var(--transition); min-height: 44px;
  -webkit-tap-highlight-color: rgba(212,175,55,.15);
}
.lang-btn:hover, .logout-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ───── Main Content ───── */
.main-content { flex: 1; margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.top-bar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 16px;
  padding: 0 24px; border-bottom: 1px solid var(--border); background: var(--bg-secondary);
  position: sticky; top: 0; z-index: 50;
}
.page-title { font-size: 18px; font-weight: 600; flex: 1; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span { display: block; width: 20px; height: 2px; background: var(--text-secondary); margin: 4px 0; transition: var(--transition); }
.top-bar-right { display: flex; align-items: center; gap: 12px; }
.top-bar-right { position: relative; }
.user-badge { display: flex; flex-direction: column; align-items: flex-end; cursor: pointer; padding: 6px 10px; border-radius: var(--radius-sm); transition: var(--transition); -webkit-tap-highlight-color: transparent; }
.user-badge:active { background: rgba(212,175,55,.1); }
.user-rank { font-size: 11px; color: var(--gold); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.user-name { font-size: 13px; color: var(--text-secondary); }
.user-menu {
  display: none; position: absolute; top: 100%; right: 0; margin-top: 6px;
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm);
  min-width: 160px; box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 200; overflow: hidden;
}
.user-menu.visible { display: block; }
.user-menu-item {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-size: 14px;
  color: var(--text-primary); text-decoration: none; border: none; background: none;
  width: 100%; cursor: pointer; transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.user-menu-item:active { background: rgba(212,175,55,.1); }
.user-menu-logout { color: #ef5350; }
.user-menu-divider { height: 1px; background: var(--border); }

.page-content { flex: 1; padding: 24px; max-width: 1200px; }

/* ───── Cards ───── */
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 16px; transition: var(--transition);
  animation: fadeUp .4s ease-out;
}
.card:hover { border-color: var(--border-active); }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.card-warning { border-color: rgba(251,191,36,.3); background: rgba(251,191,36,.05); }

/* ───── Grid ───── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* ───── Balance Card ───── */
.balance-card { background: linear-gradient(135deg, #1a1530, #241a40); border-color: rgba(212,175,55,.25); }
.balance-label { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; }
.balance-amount { font-size: 36px; font-weight: 700; color: var(--gold); margin-bottom: 12px; }
.balance-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.balance-actions { display: flex; gap: 10px; }

/* ───── ArbCore-style Balance Card ───── */
.balance-main-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.balance-main-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.balance-main-row:last-of-type { border-bottom: none; }
.balance-main-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}
.balance-main-dot.dot-green { background: #4caf50; }
.balance-main-label {
  flex: 1;
  font-size: 14px;
  color: var(--text-secondary);
}
.balance-main-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace, sans-serif;
}
.balance-main-value.balance-green { color: #4caf50; }
.balance-main-cur {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 40px;
}
.balance-withdraw-btn {
  margin-top: 16px;
  text-align: center;
}

/* ───── Stat Cards ───── */
.stat-card { text-align: center; }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: 700; }
.stat-value.gold { color: var(--gold); }

/* ───── Progress Bar ───── */
.progress-bar { height: 8px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold)); border-radius: 4px; transition: width .6s ease; }
.progress-fill.progress-gold { background: linear-gradient(90deg, var(--gold-dark), var(--gold-light)); }
.progress-text { font-size: 12px; color: var(--text-muted); text-align: right; }
.progress-section { margin-top: 16px; }
.progress-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }

/* ───── Chart ───── */
.chart-container { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 20px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.chart-bar {
  width: 100%; max-width: 48px; background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  border-radius: 6px 6px 0 0; position: relative; min-height: 4px; transition: height .5s ease;
}
.chart-val { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.chart-label { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ───── Income Grid ───── */
.income-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.income-card {
  display: flex; flex-direction: column; padding: 14px; background: var(--bg-secondary);
  border-radius: var(--radius-sm); border: 1px solid var(--border); transition: var(--transition);
}
.income-card:hover { border-color: var(--gold); }
.income-expandable { cursor: pointer; }
.income-header { display: flex; align-items: center; gap: 12px; width: 100%; }
.income-icon { font-size: 24px; }
.income-info { flex: 1; }
.income-name { font-size: 12px; color: var(--text-muted); }
.income-val { font-size: 16px; font-weight: 600; color: var(--gold); }
.income-check {
  color: #4caf50; font-size: 18px; font-weight: 700; margin-right: 4px;
}
.income-arrow {
  font-size: 14px; color: var(--text-muted); transition: transform .2s;
}
.income-open .income-arrow { transform: rotate(180deg); }
.income-details {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
}
.income-detail-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 4px;
  font-size: 12px; color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,.03);
}
.income-detail-row:last-child { border-bottom: none; }
.income-detail-date { flex: 1; color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.income-detail-line {
  background: rgba(212,175,55,.15); color: var(--gold); padding: 1px 7px;
  border-radius: 4px; font-size: 11px; font-weight: 600;
}
.income-detail-from {
  color: var(--gold); font-weight: 500; font-size: 12px;
  text-decoration: underline; text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.income-detail-amount { font-weight: 600; color: #4caf50; white-space: nowrap; font-size: 13px; }

/* ───── Transaction Rows ───── */
.tx-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.04); font-size: 13px;
}
.tx-row:last-child { border-bottom: none; }
.tx-type { font-weight: 600; min-width: 80px; }
.tx-in { color: var(--green); }
.tx-out { color: var(--red); }
.tx-info { flex: 1; min-width: 0; }
.tx-desc { color: var(--text-secondary); }
.tx-hash {
  font-size: 10px; color: var(--gold); opacity: .7;
  font-family: monospace; margin-top: 2px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tx-tag { display: inline-block; padding: 2px 6px; background: var(--bg-secondary); border-radius: 4px; font-size: 10px; color: var(--text-muted); margin-left: 4px; }
.tx-date { color: var(--text-muted); font-size: 12px; white-space: nowrap; text-align: right; }

/* ───── Status Badges ───── */
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.status-ok { background: rgba(34,197,94,.12); color: var(--green); }
.status-pending { background: rgba(251,191,36,.12); color: #fbbf24; }
.status-fail { background: rgba(248,113,113,.12); color: var(--red); }

/* ───── Tables ───── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 10px 12px; font-size: 13px; color: var(--text-secondary); border-bottom: 1px solid rgba(255,255,255,.03); }

/* ───── Rank Cards ───── */
.ranks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.rank-card {
  padding: 20px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-secondary); position: relative; transition: var(--transition);
}
.rank-card.rank-achieved { border-color: var(--gold); background: rgba(212,175,55,.06); }
.rank-card.rank-next { border-color: rgba(96,165,250,.4); box-shadow: 0 0 12px rgba(96,165,250,.1); }
.rank-card.rank-locked { opacity: .6; }
.rank-star { font-size: 14px; margin-bottom: 4px; }
.rank-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.rank-req { font-size: 12px; color: var(--text-muted); }
.rank-bonus { font-size: 14px; color: var(--gold); margin-top: 8px; font-weight: 600; }
.rank-check { position: absolute; top: 12px; right: 12px; color: var(--green); font-size: 18px; }
.rank-badge { display: inline-block; padding: 6px 16px; background: rgba(212,175,55,.12); color: var(--gold); border-radius: 20px; font-weight: 600; font-size: 14px; }
.rank-badge-lg { font-size: 24px; padding: 10px 28px; }
.rank-current { text-align: center; margin-bottom: 16px; }
.rank-partners { font-size: 13px; color: var(--text-muted); margin-top: 8px; }
.rank-max { text-align: center; color: var(--gold); font-size: 16px; font-weight: 600; margin-top: 12px; }

.shareholder-card { padding: 24px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-secondary); position: relative; text-align: center; }
.rank-benefit { font-size: 14px; color: var(--gold); margin-top: 8px; }

/* ───── Deposit Flow ───── */
.deposit-flow { max-width: 500px; }
.deposit-step { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #000; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.step-text { font-size: 14px; color: var(--text-secondary); line-height: 1.5; padding-top: 3px; }
.wallet-display {
  display: flex; align-items: center; gap: 10px; padding: 14px; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 16px; flex-wrap: wrap;
}
.wallet-display code { flex: 1; font-size: 12px; word-break: break-all; color: var(--text-primary); }
.deposit-detail { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-secondary); margin-top: 12px; }
.deposit-detail code { font-size: 11px; color: var(--text-muted); }

/* ───── Mining Cards ───── */
.mining-card { padding: 20px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; }
.mining-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mining-amount { font-size: 20px; font-weight: 700; color: var(--gold); }
.mining-stats { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-top: 8px; flex-wrap: wrap; gap: 8px; }

/* ───── Status Indicator ───── */
.status-indicator { padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13px; text-align: center; }
.status-active { background: rgba(34,197,94,.08); color: var(--green); border: 1px solid rgba(34,197,94,.2); }
.status-inactive { background: rgba(248,113,113,.08); color: var(--red); border: 1px solid rgba(248,113,113,.2); }

/* ───── Ref Link Box ───── */
.ref-link-box {
  display: flex; align-items: center; gap: 10px; padding: 14px; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-sm); flex-wrap: wrap;
}
.ref-link-box code { flex: 1; font-size: 13px; word-break: break-all; color: var(--gold); }

/* ───── Info Blocks ───── */
.info-block { display: flex; flex-direction: column; gap: 8px; }
.info-row { font-size: 13px; color: var(--text-secondary); padding: 6px 0; }

/* ───── Onboarding ───── */
.onboarding-card { text-align: center; padding: 48px 32px; }
.onboarding-icon { font-size: 64px; color: var(--gold); margin-bottom: 16px; }
.onboarding-card h2 { font-size: 24px; margin-bottom: 12px; }
.onboarding-card p { color: var(--text-secondary); font-size: 15px; margin-bottom: 24px; max-width: 400px; margin-left: auto; margin-right: auto; }
.onboarding-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 32px; text-align: left; }
.feature { padding: 12px; background: var(--bg-secondary); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary); border: 1px solid var(--border); }

/* ───── Profile ───── */
.profile-header { display: flex; align-items: center; gap: 16px; }
.profile-avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold-dark)); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; color: #000; }
.profile-name { font-size: 18px; font-weight: 600; }
.profile-rank { font-size: 13px; color: var(--gold); }
.profile-status { margin-top: 4px; font-size: 12px; }

/* ───── Filter Tabs ───── */
.filter-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tab {
  padding: 6px 14px; border-radius: 16px; border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); cursor: pointer; font-size: 12px; transition: var(--transition); text-transform: capitalize;
}
.filter-tab.active { background: var(--gold); color: #000; border-color: var(--gold); }

/* ───── Pagination ───── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.pag-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 12px; }
.pag-btn.active { background: var(--gold); color: #000; border-color: var(--gold); }

/* ───── Section Divider ───── */
.section-divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ───── Empty State ───── */
.empty-state { text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: 14px; }

/* ───── Toast ───── */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-card); border: 1px solid var(--gold); color: var(--text-primary);
  padding: 12px 24px; border-radius: var(--radius-sm); font-size: 14px; z-index: 9999;
  opacity: 0; transition: all .3s ease; pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ───── Deposit countdown ───── */
.deposit-countdown {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 0;
}
.countdown-circle {
  position: relative; width: 100px; height: 100px;
}
.countdown-circle svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.countdown-bg { fill: none; stroke: var(--border); stroke-width: 6; }
.countdown-fg { fill: none; stroke: var(--gold); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset .3s ease; }
.countdown-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: var(--gold);
}
.deposit-countdown p { color: var(--text-muted); font-size: 14px; margin: 0; }

.card-highlight { border-color: var(--gold); background: rgba(212,168,67,.06); }

/* ───── Farming ───── */
.farming-card { text-align: center; }
.farming-active { border-color: #4caf50; background: rgba(76,175,80,.04); }
.farming-desc { color: var(--text-secondary); font-size: 14px; margin: 8px 0 16px; line-height: 1.5; }
.progress-green { background: linear-gradient(90deg, #4caf50, #66bb6a) !important; }

.farming-layout { display: flex; align-items: center; gap: 20px; margin: 16px 0; }
.farming-spinner-wrap { flex-shrink: 0; }
.farming-spinner { position: relative; width: 120px; height: 120px; }
.farming-circle { width: 100%; height: 100%; transform: rotate(-90deg); }
.farming-circle .farming-bg { fill: none; stroke: var(--border); stroke-width: 5; }
.farming-circle .farming-fg { fill: none; stroke: #4caf50; stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }

.farming-spin-fg {
  stroke-dasharray: 283;
  stroke-dashoffset: 70;
  animation: farmingSpin 3s linear infinite;
}
@keyframes farmingSpin {
  0%   { stroke-dashoffset: 283; }
  50%  { stroke-dashoffset: 70; }
  100% { stroke-dashoffset: 283; }
}
.always-spin .farming-circle { transform: rotate(-90deg); animation: farmingRotate 6s linear infinite; }
@keyframes farmingRotate { 100% { transform: rotate(270deg); } }

.farming-total-amount {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #4caf50;
}
.farming-timer {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700; color: #4caf50;
}
.farming-status { color: var(--text-muted); font-size: 14px; margin-top: 12px; }

.farming-details { flex: 1; text-align: left; }
.farming-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: 13px; }
.farming-label { color: var(--text-muted); }
.farming-val { color: var(--text-primary); font-weight: 600; }
.farming-green { color: #4caf50; }

.cycle-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.cycle-title { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.cycle-dots { display: flex; justify-content: center; gap: 16px; margin-bottom: 8px; }
.cycle-dot {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border); color: var(--text-muted); font-size: 14px; font-weight: 600;
  transition: all .3s;
}
.cycle-dot.cycle-filled { border-color: #4caf50; background: rgba(76,175,80,.15); color: #4caf50; }
.cycle-next { font-size: 13px; color: var(--text-secondary); }
.cycle-next strong { color: var(--gold); }

@media (max-width: 480px) {
  .farming-layout { flex-direction: column; }
  .farming-spinner { width: 100px; height: 100px; }
  .farming-total-amount { font-size: 15px; }
}

.form-select {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-primary); color: var(--text-primary);
  font-size: 14px; appearance: none; cursor: pointer; transition: var(--transition);
}
.form-select:focus { border-color: var(--gold); outline: none; }
.form-field label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }

.wallet-display {
  background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0;
}
.wallet-label { font-size: 12px; color: var(--text-muted); width: 100%; }
.wallet-display code { flex: 1; font-size: 12px; word-break: break-all; color: var(--gold); }

.deposit-detail {
  display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted);
  border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px;
}
.deposit-detail strong { color: var(--text-primary); }

/* ───── Loading ───── */
.page-loader { display: flex; align-items: center; justify-content: center; min-height: 200px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ───── Mobile Nav ───── */
.mobile-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-sidebar); border-top: 1px solid var(--border);
  display: none; justify-content: space-around; align-items: stretch; z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.mob-nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-muted);
  text-decoration: none; font-size: 10px; padding: 10px 4px; transition: var(--transition);
  flex: 1; min-height: 56px;
  -webkit-tap-highlight-color: rgba(212,175,55,.15);
}
.mob-nav-item svg { width: 24px; height: 24px; fill: currentColor; }
.mob-nav-item.active { color: var(--gold); }
.mob-nav-item:active { background: rgba(212,175,55,.08); }

/* ───── Responsive ───── */
@media (max-width: 768px) {
  html { font-size: 14px; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.5); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .mobile-nav { display: flex !important; }
  .page-content { padding: 14px; padding-bottom: 80px; }
  .grid-2 { grid-template-columns: 1fr; }
  .balance-amount { font-size: 28px; }
  .chart-container { height: 140px; }
  .income-grid { grid-template-columns: 1fr 1fr; }
  .form-row { flex-direction: column; }
  .ranks-grid { grid-template-columns: 1fr 1fr; }
  .top-bar { padding: 0 12px; }
  .balance-actions { flex-wrap: wrap; }
  .balance-actions .btn { flex: 1; text-align: center; }
  .onboarding-features { grid-template-columns: 1fr; }
  .card { padding: 18px 16px; border-radius: 12px; }
  .card-title { font-size: 15px; }
  .btn { padding: 14px 20px; font-size: 15px; min-height: 48px; }
  .btn-sm { padding: 10px 14px; font-size: 13px; min-height: 40px; }
  .form-field input, .form-field select, .form-field textarea, .form-select {
    padding: 14px; font-size: 16px; min-height: 48px;
  }
  .tx-row { padding: 14px 0; gap: 10px; }
  .tx-type { min-width: 70px; font-size: 14px; }
  .tx-desc { font-size: 12px; }
  .filter-tabs { gap: 4px; }
  .filter-tab { padding: 8px 12px; font-size: 12px; min-height: 36px; }
  .ref-link-box { flex-direction: column; align-items: stretch; }
  .ref-link-box code { font-size: 12px; }
  .deposit-flow { max-width: 100%; }
  .wallet-display { flex-direction: column; align-items: stretch; }
  .wallet-display code { font-size: 11px; }
  .mining-stats { flex-direction: column; gap: 4px; }
  .login-card { padding: 32px 20px; }
  .onboarding-card { padding: 32px 20px; }
  .onboarding-card h2 { font-size: 20px; }
  .profile-header { gap: 12px; }
  .profile-avatar { width: 48px; height: 48px; font-size: 20px; }
  .data-table th, .data-table td { padding: 8px 6px; font-size: 12px; }
  .rank-card { padding: 16px; }
  .income-card { padding: 12px 10px; }
  .income-header { gap: 10px; }
  .income-icon { font-size: 20px; }
  .income-name { font-size: 11px; }
  .income-val { font-size: 14px; }
  .income-detail-row { gap: 6px; font-size: 11px; padding: 6px 2px; }
  .income-detail-date { font-size: 10px; }
  .toast { font-size: 13px; bottom: 80px; left: 12px; right: 12px; transform: translateY(20px); text-align: center; white-space: normal; }
  .toast.show { transform: translateY(0); }
}
@media (max-width: 400px) {
  .income-grid { grid-template-columns: 1fr; }
  .ranks-grid { grid-template-columns: 1fr; }
  .balance-amount { font-size: 24px; }
  .page-content { padding: 10px; padding-bottom: 80px; }
}

/* ───── Locked form fields ───── */
.form-field { position: relative; }
.field-locked {
  opacity: .55;
  cursor: not-allowed;
  background: rgba(255,255,255,.03) !important;
  border-color: var(--border) !important;
}
.field-lock-hint {
  position: absolute;
  right: 12px;
  bottom: 14px;
  font-size: 14px;
  pointer-events: none;
  opacity: .5;
}

/* ───── Modal ───── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity .25s;
}
.modal-overlay.visible { opacity: 1; }
.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideUp .3s ease;
}
@keyframes modalSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.modal-body { padding: 20px; }
.modal-field { margin-bottom: 16px; }
.modal-field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.modal-static-field {
  padding: 12px 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
}
.modal-field .form-select,
.modal-field .form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  box-sizing: border-box;
}
.modal-field .form-select:focus,
.modal-field .form-input:focus {
  border-color: var(--gold);
  outline: none;
}
.modal-body .wallet-display { margin: 12px 0; }
.modal-info, .auto-wd-info {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(76,175,80,.08);
  border: 1px solid rgba(76,175,80,.2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 16px;
  line-height: 1.5;
}

@media (min-width: 481px) {
  .modal-card {
    border-radius: 16px;
    margin-bottom: 40px;
  }
  .modal-overlay { align-items: center; }
}

/* ───── FAQ ───── */
.faq-list { display: flex; flex-direction: column; gap: 2px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s;
}
.faq-item:hover { border-color: var(--gold); }
.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  gap: 12px;
}
.faq-arrow {
  transition: transform .25s;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  transition: max-height .3s ease, padding .3s ease;
}
.faq-answer.open {
  max-height: 400px;
  padding: 0 16px 14px;
}

/* ───── Network selector (profile wallet) ───── */
.network-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.net-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.net-btn:hover {
  border-color: var(--gold);
  color: var(--text-primary);
}
.net-btn.net-active {
  border-color: var(--gold);
  background: rgba(212,175,55,.12);
  color: var(--gold);
}

/* ───── Saved Wallets List ───── */
.wallet-saved-list { margin-bottom: 16px; }
.wallet-saved-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(212,175,55,.04);
  border: 1px solid rgba(212,175,55,.1);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
}
.wallet-net-tag {
  background: rgba(212,175,55,.15);
  color: var(--gold);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
  min-width: 52px;
  text-align: center;
}
.wallet-addr {
  color: var(--text-secondary);
  font-family: monospace;
  font-size: 12px;
}
.wallet-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0 12px;
}

/* ───── Team Tree ───── */
.team-member-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 8px; border-bottom: 1px solid rgba(255,255,255,.04);
  cursor: pointer; transition: background .15s;
}
.team-member-row:active { background: rgba(212,175,55,.06); }
.team-member-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-member-name { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.team-member-rank {
  background: rgba(212,175,55,.12); color: var(--gold); padding: 2px 8px;
  border-radius: 4px; font-size: 11px; font-weight: 600;
}
.team-member-meta { display: flex; align-items: center; gap: 10px; }
.team-member-date { font-size: 12px; color: var(--text-muted); }
.team-member-arrow { font-size: 14px; color: var(--text-muted); transition: transform .2s; }
.team-subtree { padding-left: 16px; border-left: 2px solid rgba(212,175,55,.15); margin-left: 12px; }
.team-sub-row { font-size: 13px; }
.team-sub-row .team-member-name { font-size: 13px; }
.team-loading { padding: 8px 12px; font-size: 12px; color: var(--text-muted); }
.team-empty-sub { padding: 8px 12px; font-size: 12px; color: var(--text-muted); font-style: italic; }
.team-line-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 8px; border-bottom: 1px solid rgba(255,255,255,.04);
  cursor: pointer; transition: background .15s;
}
.team-line-row:active { background: rgba(212,175,55,.06); }
.team-line-info { display: flex; align-items: center; gap: 12px; }
.team-line-label { font-weight: 600; font-size: 14px; color: var(--gold); }
.team-line-count { font-size: 12px; color: var(--text-secondary); }
.team-line-meta { display: flex; align-items: center; gap: 10px; }
.team-line-vol { font-size: 13px; color: var(--gold); font-weight: 600; }

/* ───── Locked Section ───── */
.locked-section {
  text-align: center; padding: 32px 16px;
  background: rgba(212,175,55,.03); border: 1px dashed rgba(212,175,55,.15);
  border-radius: var(--radius-sm); margin-top: 12px;
}
.locked-icon { font-size: 48px; margin-bottom: 12px; }
.locked-title { font-size: 18px; font-weight: 700; color: var(--gold); margin-bottom: 8px; }
.locked-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 16px; }
.locked-current {
  display: inline-block; padding: 6px 16px;
  background: rgba(212,175,55,.08); border-radius: 20px;
  font-size: 13px; color: var(--text-muted);
}
.locked-current strong { color: var(--gold); }

/* ───── Materials Page ───── */
.materials-desc { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; line-height: 1.5; }
.materials-coming-soon {
  display: flex; align-items: center; gap: 12px; padding: 24px;
  background: rgba(212,175,55,.04); border: 1px dashed rgba(212,175,55,.2);
  border-radius: var(--radius-sm); color: var(--text-muted); font-size: 15px;
}
.materials-icon { font-size: 32px; }

/* ───── Language Selector ───── */
.lang-modal { max-height: 80vh; display: flex; flex-direction: column; }
.lang-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 60vh;
  padding: 8px 0;
}
.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  cursor: pointer;
  transition: background .2s;
  text-align: left;
}
.lang-option:active { background: rgba(212,175,55,.08); }
.lang-option-name { flex: 1; }
.lang-option-check {
  font-size: 14px;
  color: var(--text-muted);
  margin-left: 12px;
}
.lang-option.lang-active .lang-option-check { color: #4caf50; }
.lang-option.lang-active .lang-option-name { color: var(--gold); font-weight: 600; }

/* ───── Plan Cards (Home) ───── */
.plan-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.plan-card {
  text-align: center;
  padding: 20px 16px;
  position: relative;
  overflow: hidden;
}
.plan-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  justify-content: center;
}
.plan-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.plan-badge-1 {
  background: rgba(212,175,55,.15);
  color: var(--gold);
}
.plan-badge-2 {
  background: rgba(96,165,250,.15);
  color: var(--blue);
}
.plan-card-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.plan-card-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
}
.plan-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.4;
}
.plan-card-1 {
  border-color: rgba(212,175,55,.3);
  background: rgba(212,175,55,.04);
}
.plan-card-2 {
  border-color: rgba(96,165,250,.2);
  background: rgba(96,165,250,.03);
}
.plan-card-locked {
  border-color: rgba(100,100,100,.2);
  background: rgba(100,100,100,.03);
}
.plan-lock-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 0;
}
.plan-lock-icon {
  font-size: 36px;
  opacity: .7;
}
.plan-lock-text {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}
.plan-lock-current {
  font-size: 12px;
  color: var(--text-muted);
  opacity: .6;
}
@media (max-width: 480px) {
  .plan-cards { grid-template-columns: 1fr; }
  .plan-card { padding: 18px 14px; }
  .plan-card-amount { font-size: 20px; }
}

/* ───── Mining Tiers ───── */
.mining-tier { margin-bottom: 12px; }
.mining-tier-locked { opacity: .6; }
.mining-tier-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.mining-tier-emoji { font-size: 24px; }
.mining-tier-name { font-size: 17px; font-weight: 700; color: var(--text-primary); flex: 1; }
.mining-tier-lock { font-size: 13px; color: var(--text-muted); }
.mining-levels-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 400px) { .mining-levels-grid { grid-template-columns: 1fr; } }
.mining-level-card {
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.mining-level-active { border-color: rgba(76,175,80,.4); background: rgba(76,175,80,.04); }
.mining-level-done { border-color: rgba(100,100,100,.3); background: rgba(100,100,100,.04); }
.mining-level-locked { opacity: .5; }
.mining-level-ready { border-color: rgba(212,175,55,.4); background: rgba(212,175,55,.04); }
.ml-header { display: flex; justify-content: space-between; align-items: center; }
.ml-num { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.ml-amount { font-size: 18px; font-weight: 700; color: var(--gold); }
.ml-daily { font-size: 13px; color: var(--text-secondary); }
.ml-daily strong { color: var(--accent-green); }
.ml-target { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ml-target strong { color: var(--gold); }
.ml-status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 600; text-align: center;
}
.ml-status-badge.status-ok { background: rgba(76,175,80,.15); color: #4caf50; }
.ml-status-badge.status-done { background: rgba(100,100,100,.15); color: #888; }
.ml-status-badge.status-locked { background: rgba(100,100,100,.1); color: #888; }
.ml-status-badge.status-pending { background: rgba(255,152,0,.12); color: #ff9800; font-size: 11px; }
.ml-stats { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-muted); }

/* ───── Mining Deposit Cards ───── */
.mining-deposit-card {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
}
.mining-deposit-card.md-done { opacity: .7; }
.md-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.md-amount { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.md-target { font-size: 13px; color: var(--gold); }
.md-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}
.mining-summary {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 16px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.stat-row strong { color: var(--gold); }

/* ───── Mining Buy Modal ───── */
.ml-buy-btn {
  width: 100%; padding: 8px 0; margin-top: 6px;
  background: linear-gradient(135deg, var(--gold), #b8860b);
  color: #000; border: none; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 13px; cursor: pointer;
  transition: opacity .2s;
}
.ml-buy-btn:hover { opacity: .85; }
.ml-buy-btn:disabled { opacity: .4; cursor: not-allowed; }
.ml-buy-btn.btn-locked {
  background: rgba(100,100,100,.2); color: var(--text-muted); cursor: not-allowed;
}
.ml-progress-info {
  font-size: 12px; color: var(--text-muted);
  display: flex; flex-direction: column; gap: 3px; margin-top: 4px;
}
.ml-progress-info span { display: flex; justify-content: space-between; }
.mining-level-card .progress-bar { margin-top: 6px; }
.ml-rate-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 12px; font-weight: 700;
  background: rgba(76,175,80,.15); color: #4caf50;
}

/* Locked card */
.locked-card {
  text-align: center;
  padding: 40px 20px;
}
.locked-overlay { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.locked-icon { font-size: 48px; }
.locked-title { font-size: 18px; font-weight: 700; color: var(--gold); }
.locked-text { font-size: 14px; color: var(--text-secondary); max-width: 300px; }
.locked-rank { font-size: 13px; color: var(--text-muted); }

/* ───── Top Bar Logo ───── */
.topbar-logo {
  display: none;
  align-items: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.topbar-logo-img {
  height: 28px;
  width: auto;
  display: block;
}
.topbar-logo-icon {
  font-size: 22px;
  color: var(--gold);
}
.topbar-logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold);
}

/* ───── Inactive User Lock ───── */
.topbar-lang-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 18px;
  padding: 4px 10px;
  cursor: pointer;
  margin-left: auto;
  transition: var(--transition);
}
.topbar-lang-btn:hover { border-color: var(--gold); color: var(--gold); }
body.user-inactive .topbar-lang-btn { display: block; }

body.user-inactive .sidebar,
body.user-inactive .sidebar-overlay,
body.user-inactive #menu-toggle {
  display: none !important;
}
body.user-inactive .mobile-nav {
  display: none !important;
}
body.user-inactive .main-content {
  margin-left: 0;
}
body.user-inactive .topbar-logo {
  display: flex;
}
body.user-inactive .page-title {
  display: none;
}
body.user-inactive .user-badge {
  display: none;
}
body.user-inactive .user-menu {
  display: none !important;
}
body.user-inactive .top-bar-right {
  display: none;
}

/* ───── Binary Tree List ───── */
.bt-list { padding: 4px 0; }
.bt-row {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 8px; border-radius: 6px; font-size: 13px;
  transition: background .15s;
}
.bt-row.bt-expandable { cursor: pointer; }
.bt-row.bt-expandable:active { background: rgba(255,255,255,.04); }
.bt-row.bt-me {
  background: rgba(212,175,55,.08); border: 1px solid rgba(212,175,55,.25);
  border-radius: 8px; margin-bottom: 4px; font-weight: 600;
}
.bt-row.bt-inactive { opacity: .45; }
.bt-row.bt-empty { opacity: .3; }
.bt-icon { font-size: 14px; flex-shrink: 0; }
.bt-arrow {
  font-size: 10px; color: var(--text-muted); width: 14px; text-align: center;
  flex-shrink: 0; transition: transform .2s;
}
.bt-dot { font-size: 16px; color: var(--border); width: 14px; text-align: center; flex-shrink: 0; }
.bt-pos {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  background: rgba(255,255,255,.06); padding: 1px 5px; border-radius: 4px;
  flex-shrink: 0; min-width: 18px; text-align: center;
}
.bt-name {
  font-weight: 500; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bt-name.bt-muted { color: var(--text-muted); font-weight: 400; }
.bt-badge {
  font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 6px;
  text-transform: uppercase; flex-shrink: 0; letter-spacing: .3px;
}
.bt-badge.bt-bronze { background: rgba(205,127,50,.18); color: #cd7f32; }
.bt-badge.bt-silver { background: rgba(192,192,192,.18); color: #c0c0c0; }
.bt-badge.bt-gold { background: rgba(212,175,55,.18); color: var(--gold); }
.bt-badge.bt-aurum { background: rgba(255,140,0,.18); color: #ff8c00; }
.bt-badge.bt-diamond { background: rgba(0,191,255,.18); color: #00bfff; }
.bt-children { border-left: 1px solid rgba(255,255,255,.06); margin-left: 14px; }

/* ───── PIN boxes ───── */
.pin-row-wrap { display: flex; flex-direction: column; gap: 6px; }
.pin-row-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.pin-boxes { display: flex; gap: 10px; justify-content: center; }
.pin-box {
  width: 48px; height: 52px; border-radius: 10px;
  background: var(--card-bg); border: 1.5px solid var(--border);
  color: var(--text-primary); font-size: 22px; font-weight: 700;
  text-align: center; outline: none; caret-color: var(--gold);
  transition: border-color .2s;
}
.pin-box:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212,175,55,.2); }
.pin-warning { color: var(--text-secondary); font-size: 13px; margin: 0 0 16px; line-height: 1.5; }
.pin-no-recovery { color: #e74c3c; font-size: 12px; margin: 10px 0 0; text-align: center; font-weight: 600; }
.wallet-change-link { color: var(--gold); font-size: 13px; text-decoration: none; transition: opacity .2s; }
.wallet-change-link:hover { opacity: .8; }
.pin-section { margin: 4px 0 8px; }
.login-disclaimer { text-align: center; margin-top: 16px; }
.login-disclaimer a { color: var(--text-muted); font-size: 12px; text-decoration: underline; transition: color .2s; }
.login-disclaimer a:hover { color: var(--gold); }
.pin-input-inline {
  letter-spacing: 8px; text-align: center; font-size: 20px; font-weight: 700;
  background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 10px;
  color: var(--text-primary); padding: 10px 16px;
}
.pin-input-inline:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212,175,55,.15); }

/* ───── Spinner for pending deposits ───── */
.deposit-pending-spinner { display: flex; flex-direction: column; align-items: center; padding: 24px 0; }
.spinner-ring {
  width: 56px; height: 56px; border-radius: 50%;
  border: 4px solid rgba(212,175,55,.15);
  border-top-color: var(--gold);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ───── Touch improvements ───── */
@media (hover: none) and (pointer: coarse) {
  .nav-item:hover { background: none; color: var(--text-secondary); }
  .nav-item.active:hover { background: rgba(212,175,55,.12); color: var(--gold); }
  .nav-item:active { background: rgba(212,175,55,.1); }
  .card:hover { border-color: var(--border); }
  .income-card:hover { border-color: var(--border); transform: none; }
  .btn-gold:hover { filter: none; transform: none; }
}
