/* ============================================================
   css/pages/dashboard.css — 會員儀表板
   ============================================================ */

/* ── 個人資料區 ── */
.dash-profile {
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: linear-gradient(160deg, rgba(255,107,43,0.06) 0%, transparent 100%);
}
.dash-avatar {
  width: 52px; height: 52px;
  border-radius: var(--r-xl);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow-xs);
}
.dash-profile-info { flex: 1; min-width: 0; }
.dash-network-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--c-success-bg);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--r-full);
  padding: 3px 10px;
  font-size: var(--text-xs);
  color: var(--c-success);
  font-weight: 600;
  margin-bottom: 4px;
}
.dash-net-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-success);
}
.dash-addr-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.dash-addr {
  font-size: var(--text-sm);
  font-family: var(--font-data);
  color: var(--c-text-primary);
  font-weight: 600;
}
.dash-copy-btn {
  background: none;
  border: none;
  color: var(--c-text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 3px;
  border-radius: 4px;
  transition: var(--t-fast);
}
.dash-copy-btn:hover { color: var(--c-primary); }

.dash-level-badge {
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-xl);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
  cursor: pointer;
  transition: var(--t-fast);
}
.dash-level-badge:hover { border-color: var(--c-border); }
.dash-level-circle {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 800;
  color: #fff;
}
.dash-level-text {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
}
.dash-level-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--c-text-primary);
}

/* ── 統計卡片 2×2 ── */
.dash-stats-section {
  padding: 0 var(--sp-5) var(--sp-5);
}
.dash-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.dash-stat-card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-5) var(--sp-4);
  position: relative;
  overflow: hidden;
  transition: var(--t-fast);
}
.dash-stat-card:hover { border-color: var(--c-border); }
/* icon + 按鈕同行 */
.dash-stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}
.dash-stat-card-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  margin-bottom: 0;
}
.dash-stat-card-icon.orange { background: rgba(255,107,43,0.12); color: var(--c-primary); }
.dash-stat-card-icon.gold   { background: rgba(255,184,0,0.12);  color: var(--c-secondary); }
.dash-stat-card-icon.green  { background: rgba(16,185,129,0.12); color: var(--c-success); }
.dash-stat-card-icon.blue   { background: rgba(59,130,246,0.12); color: var(--c-info); }

.dash-stat-card-label {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  margin-bottom: 4px;
}
.dash-stat-card-val {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--c-text-primary);
  font-family: var(--font-data);
  line-height: 1.2;
}
.dash-stat-card-unit {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  font-weight: 400;
  margin-top: 2px;
}
.dash-stat-card-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(255,184,0,0.12);
  border: 1px solid rgba(255,184,0,0.25);
  border-radius: var(--r-full);
  color: var(--c-secondary);
  font-size: var(--text-xs);
  font-weight: 700;
  text-decoration: none;
  transition: var(--t-fast);
  white-space: nowrap;
}
.dash-stat-card-action-btn:hover {
  background: rgba(255,184,0,0.22);
  border-color: rgba(255,184,0,0.5);
}

/* ── 領取收益按鈕 ── */
.dash-claim-section {
  padding: 0 var(--sp-5) var(--sp-5);
}
.dash-pending-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}
.dash-pending-title {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
}
.dash-pending-amount {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--c-success);
  font-family: var(--font-data);
}

/* ── 快捷功能 ── */
.dash-quick-section {
  padding: 0 var(--sp-5) var(--sp-5);
}
.dash-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}
.dash-quick-item {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  transition: var(--t-fast);
  text-decoration: none;
}
.dash-quick-item:hover {
  border-color: var(--c-border);
  transform: translateY(-1px);
}
.dash-quick-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-lg);
  background: rgba(255,107,43,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--c-primary);
}
.dash-quick-label {
  font-size: var(--text-xs);
  color: var(--c-text-secondary);
  font-weight: 600;
  text-align: center;
}

/* ── 狀態卡片（代理 + 小區）── */
.dash-status-section {
  padding: 0 var(--sp-5) var(--sp-5);
}
.dash-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.dash-status-card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-5) var(--sp-4);
  text-align: center;
  cursor: pointer;
  transition: var(--t-fast);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}
.dash-status-card:hover {
  border-color: var(--c-border);
  transform: translateY(-1px);
}
.dash-status-icon {
  font-size: 24px;
  color: var(--c-primary);
}
.dash-status-title {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
}
.dash-status-val {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--c-text-primary);
}
.dash-status-sub {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
}

/* ── 進度條 (小區) ── */
.dash-progress-mini {
  width: 100%;
  height: 4px;
  background: var(--c-border-subtle);
  border-radius: 2px;
  overflow: hidden;
  margin-top: var(--sp-1);
}
.dash-progress-mini-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width 0.8s ease;
}

/* ── 最近活動 ── */
.dash-activity-section {
  padding: 0 var(--sp-5) var(--sp-8);
}
.dash-activity-list { }
.dash-activity-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--c-border-subtle);
}
.dash-activity-item:last-child { border-bottom: none; }
.dash-activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-activity-dot.buy    { background: var(--c-primary); }
.dash-activity-dot.stake  { background: var(--c-info); }
.dash-activity-dot.flex   { background: var(--c-secondary); }
.dash-activity-dot.reward { background: var(--c-success); }

.dash-activity-body { flex: 1; min-width: 0; }
.dash-activity-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-text-primary);
}
.dash-activity-date {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  margin-top: 2px;
}
.dash-activity-amount {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--c-text-highlight);
  font-family: var(--font-data);
  white-space: nowrap;
}

/* ── 子頁面通用 Header ── */
.dash-page-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
}
.dash-back-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-secondary);
  text-decoration: none;
  font-size: 14px;
  flex-shrink: 0;
  transition: var(--t-fast);
}
.dash-back-btn:hover { border-color: var(--c-border); color: var(--c-text-primary); }
.dash-page-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--c-text-primary);
}

/* ── Tab Group (子頁通用) ── */
.dash-tab-group {
  display: flex;
  gap: var(--sp-2);
  padding: 0 var(--sp-5) var(--sp-4);
  overflow-x: auto;
  scrollbar-width: none;
}
.dash-tab-group::-webkit-scrollbar { display: none; }
.dash-tab-group button {
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-full);
  color: var(--c-text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--t-fast);
}
.dash-tab-group button.active {
  background: var(--c-primary-glow);
  border-color: var(--c-border-hover);
  color: var(--c-primary-light);
}

/* ── 訂單列表 ── */
.dash-orders-wrap { padding: 0 var(--sp-5) var(--sp-8); }
.dash-order-item {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  margin-bottom: var(--sp-3);
}
.dash-order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}
.dash-order-id {
  font-size: var(--text-xs);
  font-family: var(--font-data);
  color: var(--c-text-muted);
  font-weight: 600;
}
.dash-order-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.dash-order-stat-label {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  display: block;
  margin-bottom: 2px;
}
.dash-order-stat-val {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--c-text-primary);
  font-family: var(--font-data);
}
.dash-order-stat-val.gold { color: var(--c-secondary); }
.dash-order-tx {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--c-bg-input);
  border-radius: var(--r-md);
  font-size: var(--text-xs);
  color: var(--c-text-muted);
}
.dash-order-tx .mono {
  flex: 1;
  font-family: var(--font-data);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--c-text-secondary);
}
.dash-order-copy {
  background: none;
  border: none;
  color: var(--c-primary);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 13px;
  flex-shrink: 0;
}

/* ── 質押記錄 (dashboard/staking) ── */
.dash-stake-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  padding: 0 var(--sp-5) var(--sp-5);
}
.dash-stake-sum-card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-3);
  text-align: center;
}
.dash-stake-sum-val {
  font-size: var(--text-md);
  font-weight: 700;
  font-family: var(--font-data);
  color: var(--c-secondary);
  line-height: 1;
  margin-bottom: 4px;
}
.dash-stake-sum-label {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
}
.dash-stake-records-wrap { padding: 0 var(--sp-5) var(--sp-8); }
.dash-stake-record {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  margin-bottom: var(--sp-3);
  position: relative;
  overflow: hidden;
}
.dash-stake-record::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--gradient-primary);
}
.dash-stake-record.redeemed::before { background: var(--c-text-muted); }
.dash-stake-record-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}
.dash-stake-record-plan {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--c-text-primary);
}
.dash-stake-record-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.dash-stake-record-label {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  display: block;
  margin-bottom: 2px;
}
.dash-stake-record-val {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-text-primary);
  font-family: var(--font-data);
}
.dash-stake-record-val.gold  { color: var(--c-secondary); }
.dash-stake-record-progress {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--r-full);
  overflow: hidden;
}
.dash-stake-record-pct {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--gradient-primary);
  transition: width 0.8s ease;
}

/* ── 收益中心 (dashboard/earnings) ── */
.earn-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  padding: 0 var(--sp-5) var(--sp-4);
}
.earn-summary-card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-5) var(--sp-4);
  text-align: center;
}
.earn-summary-label {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-2);
}
.earn-summary-val {
  font-size: var(--text-xl);
  font-weight: 800;
  font-family: var(--font-data);
  color: var(--c-text-primary);
  line-height: 1;
}
.earn-summary-val.green { color: var(--c-success); }
.earn-summary-val.gold  { color: var(--c-secondary); }
.earn-claim-all-wrap {
  padding: 0 var(--sp-5) var(--sp-5);
}
.earn-claim-all-wrap .btn-primary {
  min-height: 54px;
  font-size: var(--text-md);
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #FF6B2B 0%, #FF9500 100%);
  box-shadow: 0 4px 24px rgba(255, 107, 43, 0.45), 0 1px 0 rgba(255,255,255,0.10) inset;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.earn-claim-all-wrap .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255, 107, 43, 0.60), 0 1px 0 rgba(255,255,255,0.12) inset;
  filter: brightness(1.08);
}
.earn-claim-all-wrap .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(255, 107, 43, 0.35);
  filter: brightness(0.96);
}
.earn-tab-group {
  display: flex;
  gap: var(--sp-2);
  padding: 0 var(--sp-5) var(--sp-4);
  overflow-x: auto;
  scrollbar-width: none;
}
.earn-tab-group::-webkit-scrollbar { display: none; }
.earn-tab {
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-full);
  color: var(--c-text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--t-fast);
}
.earn-tab.active {
  background: rgba(255, 107, 43, 0.18);
  border-color: var(--c-primary);
  color: var(--c-primary-light);
  box-shadow: 0 0 10px rgba(255, 107, 43, 0.20);
}
.earn-detail-wrap { padding: 0 var(--sp-5) var(--sp-5); }
.earn-detail-card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: var(--sp-4);
}
.earn-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--c-border-subtle);
}
.earn-detail-row:last-child { border-bottom: none; }
.earn-total-row { background: rgba(255,184,0,0.06); }
.earn-detail-label {
  font-size: var(--text-sm);
  color: var(--c-text-secondary);
}
.earn-detail-val {
  font-size: var(--text-sm);
  font-weight: 700;
  font-family: var(--font-data);
  color: var(--c-text-primary);
}
.earn-detail-val.gold { color: var(--c-secondary); }
.earn-claim-btn {
  width: 100%;
  min-height: 48px;
  margin-bottom: var(--sp-2);
  letter-spacing: 0.04em;
  box-shadow: 0 3px 16px rgba(255, 107, 43, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.earn-claim-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(255, 107, 43, 0.50);
  filter: brightness(1.06);
}
.earn-claim-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(255, 107, 43, 0.25);
}
.earn-notice {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-info-bg);
  border-radius: var(--r-md);
  line-height: 1.5;
}
.earn-history-wrap { padding: 0 var(--sp-5) var(--sp-8); }
.earn-history-section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--c-text-primary);
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.earn-history-section-title::before {
  content: '';
  width: 3px; height: 14px;
  background: var(--gradient-primary);
  border-radius: var(--r-full);
}
.earn-history-list {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.earn-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--c-border-subtle);
}
.earn-history-row:last-child { border-bottom: none; }
.earn-history-type {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-text-primary);
}
.earn-history-date {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  margin-top: 2px;
}
.earn-history-amount {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--c-secondary);
  font-family: var(--font-data);
  text-align: right;
}
.earn-history-status {
  font-size: var(--text-xs);
  color: var(--c-success);
  text-align: right;
  margin-top: 2px;
}

/* ── 連接錢包提示 ── */
.dash-connect-prompt {
  padding: var(--sp-10) var(--sp-5);
  text-align: center;
}
.dash-connect-icon {
  font-size: 48px;
  color: var(--c-text-muted);
  margin-bottom: var(--sp-4);
}
.dash-connect-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--c-text-primary);
  margin-bottom: var(--sp-2);
}
.dash-connect-sub {
  font-size: var(--text-sm);
  color: var(--c-text-secondary);
  margin-bottom: var(--sp-6);
}

    /* ── Filter Tabs ── */
    .eh-filter-tabs {
      display: flex;
      gap: 8px;
      padding: 0 var(--sp-5) var(--sp-4);
      overflow-x: auto;
      scrollbar-width: none;
    }
    .eh-filter-tabs::-webkit-scrollbar { display: none; }
    .eh-filter-tab {
      flex-shrink: 0;
      padding: 8px 16px;
      border-radius: var(--r-full);
      border: 1px solid var(--c-border-subtle);
      background: transparent;
      color: var(--c-text-secondary);
      font-size: var(--text-sm);
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
    }
    .eh-filter-tab.active {
      background: var(--c-primary);
      border-color: var(--c-primary);
      color: #fff;
    }

    /* ── History Rows ── */
    .eh-list-wrap {
      padding: 0 var(--sp-5) var(--sp-8);
    }
    .eh-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: var(--sp-4) var(--sp-5);
      border-bottom: 1px solid var(--c-border-subtle);
      background: var(--c-bg-card);
    }
    .eh-row:first-child { border-radius: var(--r-xl) var(--r-xl) 0 0; }
    .eh-row:last-child  { border-bottom: none; border-radius: 0 0 var(--r-xl) var(--r-xl); }
    .eh-row-left { display: flex; align-items: center; gap: var(--sp-3); }
    .eh-icon {
      width: 36px; height: 36px;
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-size: 14px;
      flex-shrink: 0;
    }
    .eh-icon.flexible  { background: rgba(255,107,43,0.12); color: var(--c-primary); }
    .eh-icon.staking   { background: rgba(59,130,246,0.12); color: var(--c-info); }
    .eh-icon.community { background: rgba(255,184,0,0.12);  color: var(--c-secondary); }
    .eh-type {
      font-size: var(--text-sm);
      font-weight: 600;
      color: var(--c-text-primary);
    }
    .eh-date {
      font-size: var(--text-xs);
      color: var(--c-text-muted);
      margin-top: 2px;
    }
    .eh-row-right { text-align: right; }
    .eh-amount {
      font-size: var(--text-sm);
      font-weight: 700;
      color: var(--c-secondary);
      font-family: var(--font-data);
    }
    .eh-status {
      font-size: var(--text-xs);
      color: var(--c-success);
      margin-top: 2px;
    }
    .eh-status.claimed { color: var(--c-text-muted); }

    /* ── Hidden via filter ── */
    .eh-row[hidden] { display: none; }
