@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg: #0a0b14;
  --bg2: #0f1020;
  --card: #141628;
  --card2: #1a1e35;
  --border: rgba(255,255,255,0.07);
  --purple: #7c5cfc;
  --purple-light: #a389fd;
  --gold: #f5c842;
  --green: #00d48a;
  --red: #ff5e7d;
  --blue: #4facfe;
  --text: #e8eaf6;
  --muted: #7880a0;
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--purple-light); text-decoration: none; }
a:hover { color: var(--purple); }

img { max-width: 100%; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 3px; }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.page-wrap { padding: 24px 0 80px; }

/* ── Navbar ── */
.navbar {
  background: rgba(10,11,20,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  padding: 12px 0;
}
.navbar .inner { display: flex; align-items: center; justify-content: space-between; }
.navbar .logo { font-size: 1.5rem; font-weight: 800; }
.navbar .logo span { background: linear-gradient(135deg, var(--purple), var(--blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.navbar .nav-links { display: flex; gap: 8px; align-items: center; }
.navbar .nav-links a { color: var(--muted); font-size: 0.9rem; padding: 8px 14px; border-radius: 10px; transition: all .2s; }
.navbar .nav-links a:hover, .navbar .nav-links a.active { color: var(--text); background: var(--card2); }
.nav-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--purple), var(--blue)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; cursor: pointer; }
.notif-badge { position: relative; }
.notif-badge .badge { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; font-size: 10px; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-sm { padding: 14px 16px; border-radius: 12px; }

/* ── Task Cards ── */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

.task-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
  cursor: pointer;
}
.task-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(124,92,252,0.2); border-color: rgba(124,92,252,0.3); }
.task-card .thumb { width: 100%; height: 160px; object-fit: cover; background: linear-gradient(135deg, var(--card2), var(--card)); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.task-card .body { padding: 16px; }
.task-card .cat-badge { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.task-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-card .reward-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.reward-badge { background: linear-gradient(135deg, rgba(245,200,66,.15), rgba(245,200,66,.05)); border: 1px solid rgba(245,200,66,.3); color: var(--gold); padding: 4px 12px; border-radius: 20px; font-size: .85rem; font-weight: 700; }
.status-badge { font-size: .7rem; padding: 3px 10px; border-radius: 20px; font-weight: 600; }
.status-new { background: rgba(0,212,138,.1); color: var(--green); }
.status-progress { background: rgba(79,172,254,.1); color: var(--blue); }
.status-done { background: rgba(124,92,252,.1); color: var(--purple-light); }
.status-expired { background: rgba(255,94,125,.1); color: var(--red); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 12px; font-size: .95rem; font-weight: 600;
  border: none; cursor: pointer; transition: all .2s; font-family: inherit;
  white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, var(--purple), #5a3fd8); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(124,92,252,0.4); }
.btn-gold { background: linear-gradient(135deg, var(--gold), #e0a800); color: #1a1200; }
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(245,200,66,0.3); }
.btn-green { background: linear-gradient(135deg, var(--green), #00a86b); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--card2); }
.btn-danger { background: linear-gradient(135deg, var(--red), #d63051); color: #fff; }
.btn-sm { padding: 7px 16px; font-size: .82rem; border-radius: 9px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); margin-bottom: 7px; }
.form-control {
  width: 100%; padding: 12px 16px; background: var(--card2);
  border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-size: .95rem; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(124,92,252,.15); }
.form-control::placeholder { color: var(--muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ── Auth Pages ── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(ellipse at 20% 50%, rgba(124,92,252,.12) 0%, transparent 60%), radial-gradient(ellipse at 80% 20%, rgba(79,172,254,.08) 0%, transparent 60%), var(--bg); }
.auth-box { width: 100%; max-width: 440px; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .name { font-size: 2rem; font-weight: 800; background: linear-gradient(135deg, var(--purple), var(--blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.auth-logo p { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 32px; }
.auth-card h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); font-size: .88rem; margin-bottom: 24px; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .82rem; margin: 16px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-footer { text-align: center; margin-top: 20px; font-size: .88rem; color: var(--muted); }

/* ── KPI Cards ── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 28px; }
.kpi-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.kpi-card .label { font-size: .8rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.kpi-card .value { font-size: 1.8rem; font-weight: 800; margin: 6px 0; }
.kpi-card .change { font-size: .8rem; }
.kpi-card .icon { font-size: 2rem; float: right; opacity: .6; }
.kpi-purple .value { color: var(--purple-light); }
.kpi-gold .value { color: var(--gold); }
.kpi-green .value { color: var(--green); }
.kpi-blue .value { color: var(--blue); }

/* ── Wallet ── */
.wallet-hero { background: linear-gradient(135deg, rgba(124,92,252,.3), rgba(79,172,254,.2)); border: 1px solid rgba(124,92,252,.3); border-radius: 20px; padding: 32px; text-align: center; margin-bottom: 24px; }
.wallet-hero .balance-label { color: var(--muted); font-size: .9rem; }
.wallet-hero .balance-amount { font-size: 3rem; font-weight: 800; color: var(--gold); }
.wallet-hero .pending { font-size: .85rem; color: var(--muted); margin-top: 8px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 12px 16px; text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border); }
tbody td { padding: 14px 16px; font-size: .9rem; border-bottom: 1px solid rgba(255,255,255,.04); }
tbody tr:hover { background: rgba(255,255,255,.02); }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; background: var(--card2); padding: 4px; border-radius: 12px; margin-bottom: 24px; }
.tab { flex: 1; text-align: center; padding: 9px 12px; border-radius: 10px; font-size: .85rem; font-weight: 500; color: var(--muted); cursor: pointer; transition: all .2s; border: none; background: none; font-family: inherit; }
.tab.active { background: var(--card); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.3); }

/* ── Flash messages ── */
.flash-msg { padding: 14px 20px; border-radius: 12px; margin-bottom: 20px; font-weight: 500; font-size: .9rem; animation: slideIn .3s ease; }
.flash-success { background: rgba(0,212,138,.12); border: 1px solid rgba(0,212,138,.3); color: var(--green); }
.flash-error { background: rgba(255,94,125,.12); border: 1px solid rgba(255,94,125,.3); color: var(--red); }
.flash-info { background: rgba(79,172,254,.12); border: 1px solid rgba(79,172,254,.3); color: var(--blue); }

/* ── Upload Area ── */
.upload-area { border: 2px dashed var(--border); border-radius: 14px; padding: 36px 20px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.upload-area:hover, .upload-area.drag { border-color: var(--purple); background: rgba(124,92,252,.05); }
.upload-area .icon { font-size: 2.5rem; margin-bottom: 10px; }
.upload-area p { color: var(--muted); font-size: .88rem; }
.upload-area strong { color: var(--text); }

/* ── Progress bar ── */
.progress { height: 8px; background: var(--card2); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--purple), var(--blue)); border-radius: 4px; transition: width .5s; }

/* ── Sidebar (Admin) ── */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--card); border-right: 1px solid var(--border); padding: 20px 0; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .logo { padding: 0 20px 20px; border-bottom: 1px solid var(--border); margin-bottom: 12px; font-size: 1.3rem; font-weight: 800; }
.sidebar .logo span { background: linear-gradient(135deg, var(--purple), var(--blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 11px 20px; color: var(--muted); font-size: .9rem; transition: all .2s; border-left: 3px solid transparent; }
.sidebar-link:hover { color: var(--text); background: rgba(255,255,255,.04); }
.sidebar-link.active { color: var(--purple-light); background: rgba(124,92,252,.1); border-left-color: var(--purple); }
.sidebar-link .ico { width: 20px; text-align: center; }
.admin-main { flex: 1; padding: 28px; overflow-x: hidden; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.admin-header h1 { font-size: 1.5rem; font-weight: 700; }

/* ── Misc ── */
.section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.text-muted { color: var(--muted); }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-purple { color: var(--purple-light); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-purple { background: rgba(124,92,252,.15); color: var(--purple-light); }
.badge-green { background: rgba(0,212,138,.12); color: var(--green); }
.badge-red { background: rgba(255,94,125,.12); color: var(--red); }
.badge-gold { background: rgba(245,200,66,.12); color: var(--gold); }
.badge-blue { background: rgba(79,172,254,.12); color: var(--blue); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .ico { font-size: 3rem; margin-bottom: 12px; }

/* ── Bottom nav (mobile) ── */
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: rgba(20,22,40,.96); backdrop-filter: blur(16px); border-top: 1px solid var(--border); z-index: 99; padding: 8px 0 env(safe-area-inset-bottom); }
.bottom-nav .nav-items { display: flex; justify-content: space-around; }
.bottom-nav .nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 12px; color: var(--muted); font-size: .65rem; border-radius: 10px; transition: color .2s; cursor: pointer; text-decoration: none; }
.bottom-nav .nav-item .ico { font-size: 1.3rem; }
.bottom-nav .nav-item.active, .bottom-nav .nav-item:hover { color: var(--purple-light); }

/* ── Landing Page ── */
.hero { min-height: 90vh; display: flex; align-items: center; text-align: center; padding: 60px 20px; background: radial-gradient(ellipse at 50% 40%, rgba(124,92,252,.2) 0%, transparent 70%); }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; line-height: 1.15; margin-bottom: 20px; }
.hero h1 .highlight { background: linear-gradient(135deg, var(--purple), var(--blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 560px; margin: 0 auto 36px; }
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; justify-content: center; margin-top: 60px; flex-wrap: wrap; }
.hero-stats .stat { text-align: center; }
.hero-stats .stat .num { font-size: 2rem; font-weight: 800; color: var(--gold); }
.hero-stats .stat .lbl { font-size: .82rem; color: var(--muted); }
.features { padding: 80px 0; }
.features h2 { text-align: center; font-size: 2rem; font-weight: 800; margin-bottom: 48px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.feature-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.feature-card .ico { font-size: 2.5rem; margin-bottom: 14px; }
.feature-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: .88rem; line-height: 1.6; }

/* ── Animations ── */
@keyframes slideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.fade-in { animation: fadeIn .4s ease; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 768px) {
  .navbar .nav-links { display: none; }
  .bottom-nav { display: block; }
  .task-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .sidebar { display: none; }
  .admin-main { padding: 16px; }
  .hero h1 { font-size: 2.2rem; }
}
