/* ── LAYOUT ── */
.dash-layout {
  display: grid; grid-template-columns: 240px 1fr;
  min-height: 100vh; padding-top: 72px;
}
@media(max-width:768px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }
}

/* ── SIDEBAR ── */
.dash-sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 32px 16px; position: sticky; top: 72px; height: calc(100vh - 72px);
  overflow-y: auto;
}
.dash-avatar-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; padding: 0 8px; }
.dash-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #000; flex-shrink: 0;
}
.dash-user-name { font-weight: 700; font-size: 14px; }
.dash-user-email { font-size: 12px; color: var(--muted); }

.dash-nav { display: flex; flex-direction: column; gap: 4px; }
.dash-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: var(--muted);
  transition: var(--transition); cursor: pointer;
}
.dash-nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.dash-nav-item.active { background: rgba(0,200,150,0.1); color: var(--green); font-weight: 600; }

/* ── MAIN ── */
.dash-main { padding: 40px 32px; max-width: 860px; }
@media(max-width:640px) { .dash-main { padding: 24px 16px; } }

.dash-tab { display: none; }
.dash-tab.active { display: block; }
.dash-title { font-family: var(--font2); font-size: 26px; font-weight: 700; margin-bottom: 24px; }
.dash-subtitle { font-size: 16px; font-weight: 700; margin: 28px 0 12px; }

/* ── WALLET ── */
.wallet-balance-card {
  background: linear-gradient(135deg, rgba(0,200,150,0.12), rgba(155,143,255,0.08));
  border: 1px solid rgba(0,200,150,0.25); border-radius: 24px;
  padding: 36px; text-align: center; margin-bottom: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.wallet-balance-num {
  font-family: var(--font2); font-size: 48px; font-weight: 900; color: var(--green);
}
.wallet-costs-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 20px; margin-bottom: 28px;
}
.wallet-costs-title { font-weight: 700; font-size: 14px; margin-bottom: 14px; }
.cost-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: 13px; color: rgba(240,244,255,0.7);
}
.cost-badge {
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
}
.cost-badge.green  { background: rgba(0,200,150,0.15);  color: var(--green); }
.cost-badge.orange { background: rgba(255,107,53,0.15); color: var(--orange); }
.cost-badge.purple { background: rgba(155,143,255,0.15);color: var(--purple); }
.cost-note { font-size: 11px; color: rgba(0,200,150,0.7); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ── PACK LIST ── */
.pack-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.pack-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px 20px; cursor: pointer;
  transition: var(--transition); position: relative;
}
.pack-card:hover { border-color: rgba(0,200,150,0.3); transform: translateX(4px); }
.pack-popular { border-color: rgba(255,107,53,0.4); background: linear-gradient(135deg, rgba(255,107,53,0.06), var(--surface)); }
.pack-popular-badge {
  position: absolute; top: -10px; left: 16px;
  background: var(--orange); color: #000; font-size: 10px; font-weight: 800;
  padding: 2px 10px; border-radius: 100px;
}
.pack-left { display: flex; flex-direction: column; gap: 3px; }
.pack-tokens { font-weight: 700; font-size: 15px; }
.pack-label { font-size: 12px; color: var(--muted); }
.pack-btn {
  background: var(--green); color: #000; border: none; border-radius: 10px;
  padding: 8px 20px; font-weight: 700; font-size: 15px; cursor: pointer;
  transition: var(--transition);
}
.pack-btn:hover { background: #00e0a8; }
.pack-btn.orange { background: var(--orange); color: #fff; }
.pack-btn.orange:hover { background: #ff8555; }

/* ── LEGAL ── */
.legal-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin-top: 8px;
}
.legal-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: rgba(240,244,255,0.8); }
.legal-card p { font-size: 12px; color: var(--muted); line-height: 1.7; }
.legal-card a { color: var(--green); }

/* ── TRANSACTIONS ── */
.tx-list { display: flex; flex-direction: column; gap: 8px; }
.tx-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 16px;
}
.tx-icon { font-size: 20px; flex-shrink: 0; }
.tx-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.tx-note { font-size: 13px; font-weight: 500; }
.tx-date { font-size: 11px; color: var(--muted); }
.tx-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.tx-amount { font-size: 15px; font-weight: 700; }
.tx-bal { font-size: 11px; color: var(--muted); }

/* ── PROFILE GRID ── */
.profile-grid { display: flex; flex-direction: column; gap: 8px; }
.profile-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px;
}
.profile-key { font-size: 13px; color: var(--muted); }
.profile-val { font-size: 13px; font-weight: 600; }

/* ── ADMIN ── */
.admin-nav-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,107,53,0.15); border: 1px solid rgba(255,107,53,0.3);
  color: var(--orange); font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 100px;
}
.admin-loading { display: flex; justify-content: center; padding: 40px; }
.admin-user-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 18px; margin-bottom: 10px;
  cursor: pointer; transition: var(--transition);
}
.admin-user-row:hover { border-color: rgba(0,200,150,0.3); transform: translateX(4px); }
.admin-user-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #000;
}
.admin-user-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.admin-user-name { font-size: 14px; font-weight: 600; }
.admin-user-email { font-size: 12px; color: var(--muted); }
.admin-user-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-stat-badge {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 100px;
  background: rgba(255,255,255,0.06); color: var(--muted);
}
.admin-stat-badge.green { background: rgba(0,200,150,0.12); color: var(--green); }

/* ── USER DETAIL PANEL ── */
.detail-panel {
  position: fixed; top: 0; right: -100%; width: min(520px, 100vw);
  height: 100vh; background: var(--bg); border-left: 1px solid var(--border);
  z-index: 200; transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column; overflow: hidden;
}
.detail-panel.open { right: 0; }
.detail-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px); z-index: 199;
}
.detail-panel-inner { display: flex; flex-direction: column; height: 100%; }
.detail-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.detail-header h3 { font-family: var(--font2); font-size: 18px; font-weight: 700; }
.detail-section { margin-bottom: 28px; }
.detail-section h4 { font-size: 14px; font-weight: 700; margin-bottom: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.detail-balance {
  font-family: var(--font2); font-size: 32px; font-weight: 800; color: var(--green);
  background: rgba(0,200,150,0.08); border: 1px solid rgba(0,200,150,0.2);
  border-radius: 16px; padding: 20px; text-align: center;
}
.adjust-row { display: flex; gap: 8px; flex-wrap: wrap; }
.adjust-input {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; color: var(--text); font-size: 14px; font-family: var(--font);
  flex: 1; min-width: 120px;
}
.adjust-input:focus { outline: none; border-color: var(--green); }
.log-detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}

/* ── PAGINATION ── */
.pagination-bar { display:flex; gap:6px; justify-content:center; margin-top:20px; flex-wrap:wrap; }
.pg-btn {
  background:var(--surface); border:1px solid var(--border); color:var(--muted);
  border-radius:8px; padding:6px 12px; font-size:13px; font-weight:600;
  cursor:pointer; font-family:var(--font); transition:var(--transition);
}
.pg-btn:hover:not([disabled]) { border-color:var(--green); color:var(--green); }
.pg-btn.pg-active { background:rgba(0,200,150,0.15); border-color:var(--green); color:var(--green); }
.pg-btn[disabled] { opacity:0.3; cursor:default; }

/* ── REGISTRY ── */
.registry-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 18px; margin-bottom: 10px;
}
.registry-email { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.registry-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }

/* ── HISTORY ── */
.history-day-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; margin-bottom: 12px;
}
.history-day-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; cursor: pointer; transition: var(--transition);
}
.history-day-header:hover { background: rgba(255,255,255,0.03); }
.history-day-label { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.history-day-macros { display: flex; gap: 6px; flex-wrap: wrap; }
.history-day-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.history-day-body { display: none; border-top: 1px solid var(--border); }
.history-day-card.open .history-day-body { display: block; }
.history-log-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 10px 18px; border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 12px;
}
.history-log-row:last-child { border-bottom: none; }
.history-log-name { font-size: 13px; font-weight: 500; }
.history-log-qty  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.history-log-macros { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.macro-chip {
  font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 5px;
}
.macro-chip.orange { background: rgba(255,107,53,0.15); color: var(--orange); }
.macro-chip.green  { background: rgba(0,200,150,0.15);  color: var(--green); }
.macro-chip.purple { background: rgba(155,143,255,0.15);color: var(--purple); }

/* ── ADMIN CONTROLS ── */
.admin-tab-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.admin-controls { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── REGISTRY ── */
.registry-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 18px; margin-bottom: 10px;
}
.registry-email-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.registry-email { font-weight: 700; font-size: 14px; }
.registry-count { font-size: 12px; color: var(--muted); margin-left: auto; }
.dup-badge {
  background: rgba(255,77,106,0.15); color: #ff4d6a;
  font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 100px;
}
.registry-accounts { display: flex; flex-direction: column; gap: 6px; }
.registry-header-row {
  display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.registry-account-row {
  display: flex; justify-content: space-between;
  font-size: 12px; padding: 4px 0;
}
