/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sol-purple: #9945FF;
  --sol-green: #14F195;
  --sol-green-dark: #0cc97a;
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --surface2: #F0F1F7;
  --border: #E4E5EF;
  --text: #0D0E14;
  --text2: #6B6E87;
  --text3: #9EA1B8;
  --purple-light: #F3EEFF;
  --green-light: #E6FFF5;
  --amber: #F5A623;
  --amber-light: #FFF8EC;
  --blue: #3B82F6;
  --blue-light: #EFF6FF;
  --red: #EF4444;
  --red-light: #FEF2F2;
  --sidebar-w: 230px;
  --topbar-h: 60px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --font: 'DM Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  width: 36px; height: 36px;
  background: var(--sol-purple);
  color: #fff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  font-family: var(--font-mono);
}

.logo-text {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  padding: 12px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 400;
  color: var(--text2);
  transition: all 0.15s;
  position: relative;
}

.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}

.nav-item.active {
  background: var(--purple-light);
  color: var(--sol-purple);
  font-weight: 500;
}

.nav-badge {
  margin-left: auto;
  background: var(--sol-purple);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  font-family: var(--font-mono);
}

.sidebar-bottom {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.sol-balance-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--purple-light);
  border: 1px solid #D8BFFF;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--sol-purple);
}

.sol-icon { font-family: var(--font-mono); font-size: 14px; }

/* ===== TOPBAR ===== */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 90;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text2);
  padding: 4px;
}

.topbar-search {
  flex: 1;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  height: 38px;
}

.topbar-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  outline: none;
}

.topbar-search input::placeholder { color: var(--text3); }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.notif-btn {
  position: relative;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text2);
  transition: background 0.15s;
}

.notif-btn:hover { background: var(--surface2); }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.user-avatar {
  width: 36px; height: 36px;
  background: var(--sol-green);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #0a5c38;
  cursor: pointer;
  transition: transform 0.15s;
}

.user-avatar:hover { transform: scale(1.05); }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 28px 32px;
  min-height: calc(100vh - var(--topbar-h));
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text2);
}

.page-subtitle strong { color: var(--sol-purple); font-weight: 600; }

.date-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text2);
  font-family: var(--font-mono);
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.stat-icon.purple { background: var(--purple-light); }
.stat-icon.green { background: var(--green-light); }
.stat-icon.amber { background: var(--amber-light); }
.stat-icon.blue { background: var(--blue-light); }

.stat-body { flex: 1; }

.stat-label {
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.stat-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
  font-family: var(--font-mono);
  color: var(--text);
}

.stat-unit {
  font-size: 13px;
  font-weight: 400;
  color: var(--text3);
}

.stat-trend {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  align-self: flex-start;
}

.stat-trend.up { background: var(--green-light); color: #0a7a4a; }
.stat-trend.neutral { background: var(--surface2); color: var(--text3); }

/* ===== SECTIONS ===== */
.section { margin-bottom: 32px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.see-all {
  font-size: 13px;
  color: var(--sol-purple);
  font-weight: 500;
  transition: opacity 0.15s;
}

.see-all:hover { opacity: 0.7; }

/* ===== TASK CARDS ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.task-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #C4A0FF;
  transform: translateY(-1px);
}

.task-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.task-ico {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

.reward-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
}

.reward-pill.green { background: var(--green-light); color: #0a7a4a; }
.reward-pill.purple { background: var(--purple-light); color: var(--sol-purple); }

.task-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.task-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 14px;
}

.task-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.task-meta {
  font-size: 12px;
  color: var(--text3);
  font-family: var(--font-mono);
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--sol-purple);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-block;
  transition: all 0.15s;
}

.btn-primary:hover { background: #7c35d4; transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-primary.full-width { width: 100%; text-align: center; }

.btn-outline {
  background: transparent;
  color: var(--sol-purple);
  border: 1.5px solid var(--sol-purple);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-block;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-outline:hover { background: var(--purple-light); }

.btn-ghost {
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-ghost:hover { background: var(--border); }

/* ===== SURVEY LIST ===== */
.survey-list { display: flex; flex-direction: column; gap: 12px; }

.survey-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

.survey-row:hover { box-shadow: var(--shadow-md); border-color: #C4A0FF; }

.survey-info { flex: 1; }

.survey-reward {
  font-size: 12px;
  font-weight: 700;
  color: var(--sol-purple);
  font-family: var(--font-mono);
  margin-bottom: 3px;
}

.survey-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.survey-meta {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 8px;
}

.progress-wrap {
  height: 4px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sol-purple), #14F195);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ===== VIDEO CARDS ===== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.2s;
  cursor: pointer;
}

.video-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.video-thumb {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.play-circle {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,0.5);
  transition: transform 0.15s;
}

.video-card:hover .play-circle { transform: scale(1.1); }

.play-circle svg { margin-left: 3px; }

.video-dur {
  position: absolute;
  bottom: 8px; right: 10px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.video-info { padding: 14px; }

.video-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 5px;
}

.video-reward {
  font-size: 12px;
  color: #0a7a4a;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* ===== WALLET ===== */
.wallet-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.wallet-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.wallet-card:last-child { margin-bottom: 0; }

.wallet-balance-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.wallet-ico {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--purple-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  font-family: var(--font-mono);
  color: var(--sol-purple);
}

.wc-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 2px;
}

.balance-big {
  font-size: 36px;
  font-weight: 700;
  color: var(--sol-purple);
  font-family: var(--font-mono);
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.balance-usd {
  font-size: 14px;
  color: var(--text3);
  margin-bottom: 14px;
}

.wallet-addr {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text2);
  font-family: var(--font-mono);
  word-break: break-all;
}

.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s;
  outline: none;
}

.form-input:focus { border-color: var(--sol-purple); box-shadow: 0 0 0 3px rgba(153,69,255,0.1); }

.wallet-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.tx-list { display: flex; flex-direction: column; }

.tx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.tx-row:last-child { border-bottom: none; }

.tx-left { display: flex; align-items: center; gap: 12px; }

.tx-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tx-dot.in { background: var(--sol-green); }
.tx-dot.out { background: var(--red); }

.tx-type { font-size: 14px; font-weight: 500; }
.tx-date { font-size: 11px; color: var(--text3); font-family: var(--font-mono); }

.tx-amount { font-size: 14px; font-weight: 600; font-family: var(--font-mono); }
.tx-amount.in { color: #0a7a4a; }
.tx-amount.out { color: var(--red); }

/* ===== REFERRAL ===== */
.ref-hero {
  background: linear-gradient(135deg, var(--purple-light) 0%, #E8F9FF 100%);
  border: 1px solid #D8BFFF;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.ref-hero-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.ref-hero-sub {
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 16px;
}

.ref-link-row {
  display: flex;
  gap: 10px;
}

.ref-link-box {
  flex: 1;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text2);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ref-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.ref-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.ref-table-head {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  padding: 10px 18px;
  background: var(--surface2);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text3);
}

.ref-table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  align-items: center;
  transition: background 0.15s;
}

.ref-table-row:hover { background: var(--surface2); }

.status-pill {
  background: var(--green-light);
  color: #0a7a4a;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-block;
}

/* ===== FILTER TABS ===== */
.filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  transition: all 0.15s;
}

.filter-tab:hover { border-color: var(--sol-purple); color: var(--sol-purple); }

.filter-tab.active {
  background: var(--sol-purple);
  color: #fff;
  border-color: var(--sol-purple);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .wallet-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .topbar { left: 0; }
  .main-content { margin-left: 0; padding: 20px 16px; }
  .menu-toggle { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .ref-stats { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; gap: 12px; }
  .ref-table-head, .ref-table-row { grid-template-columns: 2fr 1fr 1fr; }
  .ref-table-head div:nth-child(4), .ref-table-row div:nth-child(4) { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
}
