:root {
  --bg: #f3f0ff;
  --bg2: #eef2ff;
  --surface: #ffffff;
  --text: #1e1b4b;
  --muted: #6b7280;
  --line: #e9e5ff;
  --primary: #7c3aed;
  --primary2: #6d28d9;
  --success: #059669;
  --danger: #e11d48;
  --radius: 20px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --shadow: 0 10px 40px rgba(99, 102, 241, 0.08);
  --shadow-lg: 0 20px 50px rgba(79, 70, 229, 0.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: linear-gradient(180deg, #f5f3ff 0%, #eef2ff 40%, #f8fafc 100%);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 88px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }

/* Auth */
.auth-body {
  display: grid; place-items: center; min-height: 100vh; padding: 24px;
  background: linear-gradient(160deg, #ede9fe, #e0e7ff 50%, #f8fafc);
}
.auth-card {
  width: 100%; max-width: 380px; text-align: center;
  background: #fff; border: 1px solid var(--line);
  border-radius: 28px; padding: 36px 26px; box-shadow: var(--shadow-lg);
}
.logo-ring {
  width: 76px; height: 76px; border-radius: 24px; margin: 0 auto 18px;
  display: grid; place-items: center; font-size: 34px;
  background: linear-gradient(145deg, #8b5cf6, #6366f1);
  box-shadow: 0 14px 32px rgba(124, 58, 237, 0.35);
}
.auth-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 8px; }
.err { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
  background: rgba(255,255,255,.88); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.back-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none; background: #fff;
  box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer;
  color: var(--text); font-size: 18px;
}
.user-mini img {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  border: 2px solid #c4b5fd; box-shadow: 0 4px 12px rgba(124,58,237,.2);
}

.page { padding: 18px 16px 24px; max-width: 480px; margin: 0 auto; }
.hello { font-size: 15px; margin-bottom: 16px; color: var(--muted); }
.hello b { color: var(--text); font-weight: 700; }

/* Balance */
.balance-card {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 55%, #2563eb 100%);
  border-radius: 24px; padding: 24px 22px; margin-bottom: 18px; color: #fff;
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.35);
  position: relative; overflow: hidden;
}
.balance-card::after {
  content: ""; position: absolute; right: -20px; top: -30px;
  width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.12);
}
.balance-card.mini { padding: 18px; }
.bc-label { font-size: 13px; opacity: .9; position: relative; z-index: 1; }
.bc-amount { font-size: 36px; font-weight: 800; letter-spacing: -.04em; margin: 8px 0 4px; position: relative; z-index: 1; }
.bc-sub { font-size: 12px; opacity: .85; position: relative; z-index: 1; }

/* Stats */
.stats-row {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px;
}
.stat-box {
  background: #fff; border-radius: 18px; padding: 16px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px;
}
.stat-ico {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  flex-shrink: 0;
}
.stat-ico svg { width: 22px; height: 22px; }
.ico-blue { background: #eff6ff; color: #2563eb; }
.ico-purple { background: #f5f3ff; color: #7c3aed; }
.ico-orange { background: #fff7ed; color: #ea580c; }
.ico-green { background: #ecfdf5; color: #059669; }
.stat-box .sv { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.stat-box .sk { font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 500; }

/* Quick actions */
.quick-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px;
}
.quick-btn {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 6px; text-align: center; box-shadow: var(--shadow);
  color: var(--text); font-size: 11px; font-weight: 600;
  transition: transform .12s, box-shadow .15s;
}
.quick-btn:active { transform: scale(.96); }
.quick-btn .qi {
  width: 40px; height: 40px; border-radius: 12px; margin: 0 auto 8px;
  display: grid; place-items: center;
}
.quick-btn .qi svg { width: 20px; height: 20px; }
.qi-task { background: #ede9fe; color: #7c3aed; }
.qi-wd { background: #d1fae5; color: #059669; }
.qi-ref { background: #dbeafe; color: #2563eb; }
.qi-pro { background: #fce7f3; color: #db2777; }

.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 8px 0 12px;
}
.sec-title { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }

.list-card, .card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.list-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid #f1f5f9; gap: 10px;
}
.list-row:last-child { border-bottom: none; padding-bottom: 0; }
.list-row:first-child { padding-top: 0; }

.badge {
  display: inline-block; padding: 5px 11px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: capitalize;
}
.badge-pending { background: #fff7ed; color: #c2410c; }
.badge-approved { background: #ecfdf5; color: #047857; }
.badge-rejected { background: #fff1f2; color: #be123c; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 16px; padding: 15px 18px; font-weight: 700;
  font-size: 15px; cursor: pointer; font-family: inherit; width: 100%;
  transition: transform .12s, filter .15s; letter-spacing: -.01em;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: linear-gradient(180deg, #8b5cf6, #7c3aed); color: #fff;
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.35); margin-top: 12px;
}
.btn-success {
  background: linear-gradient(180deg, #34d399, #059669); color: #fff;
  box-shadow: 0 12px 28px rgba(5, 150, 105, 0.3); margin-top: 12px;
}
.btn-dark {
  background: #1e1b4b; color: #fff; margin-top: 12px;
  box-shadow: 0 12px 28px rgba(30, 27, 75, 0.25);
}
.btn-tg {
  background: linear-gradient(180deg, #2AABEE, #229ED9); color: #fff; margin-top: 16px;
  box-shadow: 0 12px 28px rgba(42, 171, 238, 0.35);
}
.btn-ch {
  background: #f5f3ff; color: var(--primary2); border: 1.5px solid #ddd6fe; margin-top: 10px;
}
.btn-outline {
  background: #fff; color: var(--primary); border: 1.5px solid #ddd6fe; margin-top: 10px;
}

label { display: block; font-size: 13px; font-weight: 600; color: #4b5563; margin: 12px 0 6px; }
input, select, textarea {
  width: 100%; padding: 13px 14px; border-radius: 14px;
  border: 1.5px solid var(--line); background: #fafafa; color: var(--text);
  font-size: 14px; font-family: inherit; outline: none; transition: border .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: #a78bfa; box-shadow: 0 0 0 4px rgba(124,58,237,.12); background: #fff; }

/* File upload boxes */
.file-box {
  border: 1.5px dashed #c4b5fd; border-radius: 14px; padding: 14px;
  background: #faf8ff; margin-bottom: 12px;
}
.file-box input[type=file] { border: none; background: transparent; padding: 6px 0; }

/* Bottom nav - SVG icons */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; background: rgba(255,255,255,.96); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 8px 6px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.06);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: #9ca3af; font-size: 10px; font-weight: 600; padding: 6px 2px;
  text-decoration: none; transition: color .15s, transform .12s;
}
.nav-item svg { width: 24px; height: 24px; stroke-width: 1.8; }
.nav-item.active { color: var(--primary); }
.nav-item.active svg { stroke-width: 2.2; }
.nav-item:active { transform: scale(.94); }

/* Modal */
.modal-bg {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, .55); display: grid; place-items: center; padding: 20px;
  animation: fadeIn .25s ease;
}
.modal {
  width: 100%; max-width: 360px; background: #fff;
  border-radius: 24px; padding: 26px 22px; box-shadow: var(--shadow-lg);
  animation: slideUp .3s ease;
}
.modal h2 { font-size: 20px; margin-bottom: 8px; font-weight: 800; }

/* Task list cards */
.task-list-card {
  background: #fff; border-radius: 20px; overflow: hidden; margin-bottom: 14px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.task-list-card:active { transform: scale(.99); }
.task-list-card .thumb {
  width: 100%; height: 140px; object-fit: cover; background: linear-gradient(135deg,#a78bfa,#6366f1);
  display: block;
}
.task-list-body { padding: 14px 16px 16px; }
.task-list-body h3 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.reward-chip {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--primary); font-weight: 700; font-size: 14px; margin-bottom: 10px;
}
.task-list-body .btn { margin-top: 4px; padding: 12px; font-size: 14px; border-radius: 14px; }

/* Task detail */
.task-hero {
  width: 100%; border-radius: 20px; overflow: hidden; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.task-hero img { width: 100%; display: block; max-height: 200px; object-fit: cover; }
.task-hero-fallback {
  height: 160px; background: linear-gradient(135deg, #34d399, #059669);
  display: grid; place-items: center; color: #fff; font-size: 42px; font-weight: 800;
}
.detail-card {
  background: #fff; border-radius: 20px; padding: 20px; margin-bottom: 14px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.detail-card h1 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.steps { list-style: none; margin-top: 14px; }
.steps li {
  display: flex; gap: 12px; margin-bottom: 12px; font-size: 14px; line-height: 1.5; color: #374151;
}
.step-num {
  width: 24px; height: 24px; border-radius: 8px; flex-shrink: 0;
  background: #ede9fe; color: var(--primary); font-size: 12px; font-weight: 800;
  display: grid; place-items: center;
}
.submit-card {
  background: #fff; border-radius: 20px; padding: 18px; margin-bottom: 14px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.submit-card h3 { font-size: 15px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

.profile-card { text-align: center; padding: 28px 16px 20px; }
.avatar-lg {
  width: 100px; height: 100px; border-radius: 50%; object-fit: cover;
  border: 3px solid #a78bfa; box-shadow: 0 8px 28px rgba(124,58,237,.3); margin-bottom: 14px;
}
.id-chip {
  display: inline-block; margin-top: 8px; padding: 7px 16px; border-radius: 999px;
  background: #f5f3ff; font-size: 13px; font-weight: 600; color: #6d28d9;
}
.link-box {
  background: #faf8ff; border: 1.5px dashed #c4b5fd; border-radius: 14px;
  padding: 14px; font-size: 12px; word-break: break-all; margin: 12px 0; color: #4c1d95;
}
.alert { padding: 13px 14px; border-radius: 14px; font-size: 13px; margin-bottom: 12px; font-weight: 500; }
.alert.ok { background: #ecfdf5; color: #047857; }
.alert.err { background: #fff1f2; color: #be123c; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.quick-row{display:none!important}


/* NEXEARN brand */
.topbar .brand {
  font-family: 'Outfit', Inter, system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: 0.05em;
  font-size: 1.05rem;
}
.auth-card h1, .brand-title {
  font-family: 'Outfit', Inter, system-ui, sans-serif;
}
