:root {
  --bg: #06090f;
  --bg-soft: #0c121c;
  --panel: #111827;
  --panel-border: #1f2937;
  --text: #e8ecf3;
  --text-dim: #93a0b4;
  --gold: #f0b90b;
  --gold-soft: #ffd75e;
  --emerald: #16d39a;
  --danger: #f2545b;
  --radius: 14px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  scroll-behavior: smooth;
}

h1, h2, h3, .brand {
  font-family: 'Sora', 'Manrope', sans-serif;
}

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

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: rgba(6, 9, 15, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--panel-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--emerald));
  box-shadow: 0 0 16px var(--gold);
}

.nav-actions { display: flex; gap: 12px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #1a1400;
  box-shadow: 0 8px 24px rgba(240, 185, 11, 0.25);
}

.btn-primary:hover { box-shadow: 0 10px 30px rgba(240, 185, 11, 0.4); }

.btn-ghost {
  background: transparent;
  border-color: var(--panel-border);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--gold); color: var(--gold-soft); }

.btn-block { width: 100%; }

.btn-danger { background: rgba(242, 84, 91, 0.12); color: var(--danger); border-color: rgba(242, 84, 91, 0.3); }
.btn-sm { padding: 8px 14px; font-size: 0.82rem; border-radius: 8px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 110px 0 90px;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -150px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(240, 185, 11, 0.18), transparent 70%);
  filter: blur(20px);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -220px;
  left: -180px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(22, 211, 154, 0.15), transparent 70%);
  filter: blur(20px);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(240, 185, 11, 0.1);
  border: 1px solid rgba(240, 185, 11, 0.3);
  color: var(--gold-soft);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: 3.1rem;
  line-height: 1.12;
  margin: 0 0 20px;
  font-weight: 800;
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--gold-soft), var(--emerald));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  color: var(--text-dim);
  font-size: 1.12rem;
  line-height: 1.65;
  max-width: 520px;
  margin-bottom: 34px;
}

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.stat-row {
  display: flex;
  gap: 36px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.stat-row .stat b {
  display: block;
  font-size: 1.7rem;
  font-family: 'Sora', sans-serif;
  color: var(--gold-soft);
}

.stat-row .stat span {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ---------- Hero visual card ---------- */
.hero-card {
  position: relative;
  background: linear-gradient(160deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.hero-card .card-label { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 6px; }
.hero-card .card-amount { font-family: 'Sora', sans-serif; font-size: 2.3rem; font-weight: 800; margin-bottom: 18px; }
.hero-card .card-amount .up { color: var(--emerald); font-size: 1rem; margin-left: 8px; }

.mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 90px;
  margin: 18px 0 22px;
}

.mini-bars .bar {
  flex: 1;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--gold-soft), rgba(240, 185, 11, 0.25));
}

.hero-card .divider { border-top: 1px solid var(--panel-border); margin: 18px 0; }

.hero-card .row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.hero-card .row-item b { color: var(--text); font-weight: 700; }
.hero-card .pill { color: var(--emerald); background: rgba(22, 211, 154, 0.12); padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }

/* ---------- Features ---------- */
.section { padding: 80px 0; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 50px; }
.section-head h2 { font-size: 2.1rem; margin-bottom: 14px; }
.section-head p { color: var(--text-dim); font-size: 1.02rem; line-height: 1.6; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover { transform: translateY(-4px); border-color: rgba(240, 185, 11, 0.4); }

.feature-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(240, 185, 11, 0.18), rgba(22, 211, 154, 0.14));
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.feature-card h3 { margin: 0 0 10px; font-size: 1.12rem; }
.feature-card p { color: var(--text-dim); font-size: 0.92rem; line-height: 1.55; margin: 0; }

/* ---------- Steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step {
  position: relative;
  padding: 26px 22px 22px;
  background: var(--bg-soft);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
}

.step .step-num {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--gold-soft);
  margin-bottom: 10px;
}

.step h3 { margin: 0 0 8px; font-size: 1.02rem; }
.step p { color: var(--text-dim); font-size: 0.9rem; margin: 0; line-height: 1.5; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, rgba(240, 185, 11, 0.12), rgba(22, 211, 154, 0.08));
  border: 1px solid rgba(240, 185, 11, 0.25);
  border-radius: 20px;
  padding: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cta-band h2 { margin: 0 0 8px; font-size: 1.7rem; }
.cta-band p { margin: 0; color: var(--text-dim); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--panel-border);
  padding: 30px 0;
  color: var(--text-dim);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}

.auth-wrap::before {
  content: '';
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(240, 185, 11, 0.15), transparent 70%);
  filter: blur(10px);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 38px 34px;
  box-shadow: var(--shadow);
}

.auth-card .brand { justify-content: center; margin-bottom: 8px; }
.auth-card .auth-title { text-align: center; font-size: 1.4rem; margin: 6px 0 4px; }
.auth-card .auth-sub { text-align: center; color: var(--text-dim); font-size: 0.9rem; margin-bottom: 26px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input[type="text"],
input[type="password"],
input[type="tel"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

input:focus { border-color: var(--gold); }

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 18px;
}

.alert-error { background: rgba(242, 84, 91, 0.12); color: var(--danger); border: 1px solid rgba(242, 84, 91, 0.3); }
.alert-success { background: rgba(22, 211, 154, 0.12); color: var(--emerald); border: 1px solid rgba(22, 211, 154, 0.3); }

.auth-footer { text-align: center; margin-top: 20px; font-size: 0.88rem; color: var(--text-dim); }
.auth-footer a { color: var(--gold-soft); font-weight: 700; }

/* ---------- App shell (admin/user panels) ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  background: var(--bg-soft);
  border-right: 1px solid var(--panel-border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar .brand { margin-bottom: 26px; padding: 0 6px; }

.sidebar .side-link {
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.92rem;
}

.sidebar .side-link.active, .sidebar .side-link:hover { background: rgba(240, 185, 11, 0.1); color: var(--gold-soft); }

.sidebar .side-foot { margin-top: auto; }

.main-content { flex: 1; padding: 30px 36px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.topbar h1 { font-size: 1.5rem; margin: 0; }
.topbar .user-chip { display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: 0.9rem; }
.topbar-logout { display: none; }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--emerald));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #10141d;
}

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 28px; }

.stat-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 22px;
}

.stat-card .stat-card-label { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 10px; }
.stat-card .stat-card-value { font-family: 'Sora', sans-serif; font-size: 1.8rem; font-weight: 800; }

.panel-block {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 24px;
}

.invest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.panel-block h2 { margin: 0 0 18px; font-size: 1.15rem; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
.table-scroll table { min-width: 640px; }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  color: var(--text-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--panel-border);
}
tbody td { padding: 13px 12px; border-bottom: 1px solid var(--panel-border); font-size: 0.92rem; }
tbody tr:last-child td { border-bottom: none; }

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.tag-admin { background: rgba(240, 185, 11, 0.15); color: var(--gold-soft); }
.tag-user { background: rgba(22, 211, 154, 0.12); color: var(--emerald); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); }

.inline-form { display: inline-flex; gap: 6px; align-items: center; }

select {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 0.82rem;
}

/* ---------- Live earnings counter ---------- */
.live-earnings-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, #10190f 0%, var(--panel) 55%, var(--bg-soft) 100%);
  border: 1px solid rgba(22, 211, 154, 0.35);
  border-radius: 20px;
  padding: 30px 32px;
  margin-bottom: 24px;
  box-shadow: 0 0 0 rgba(22, 211, 154, 0);
  animation: card-glow 3.2s ease-in-out infinite;
}

@keyframes card-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(22, 211, 154, 0); }
  50% { box-shadow: 0 0 34px rgba(22, 211, 154, 0.16); }
}

.live-earnings-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.live-earnings-label {
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 600;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--emerald);
  letter-spacing: 0.03em;
}

.live-dot .dot-blink {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  animation: blink 1.4s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

.live-earnings-amount {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 3rem;
  line-height: 1.1;
  color: var(--emerald);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.live-earnings-amount .sub-cents {
  font-size: 0.5em;
  opacity: 0.55;
  font-weight: 700;
  vertical-align: super;
  margin-left: 2px;
}

.live-earnings-sub {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 10px;
}

.live-earnings-sub b { color: var(--text); }

.day-progress-track {
  margin-top: 18px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.day-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--emerald), var(--gold-soft));
  width: 0%;
  transition: width 0.4s linear;
}

.live-earnings-card.is-idle {
  animation: none;
  border-color: var(--panel-border);
}

.live-earnings-card.is-idle .live-earnings-amount { color: var(--text-dim); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .features-grid, .steps { grid-template-columns: 1fr; }
  .invest-grid { grid-template-columns: 1fr; }
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 14px;
    align-items: center;
    gap: 4px;
  }
  .sidebar .brand { margin-bottom: 0; flex-shrink: 0; }
  .sidebar .side-link { flex-shrink: 0; white-space: nowrap; }
  .sidebar .side-foot { display: none; }
  .topbar-logout { display: inline-flex; flex-shrink: 0; }
  .field-row { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.2rem; }
  .live-earnings-amount { font-size: 2.2rem; }
  .main-content { padding: 22px 18px; }
  .cta-band { padding: 32px 24px; flex-direction: column; text-align: center; }
}

@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .navbar { padding: 12px 16px; }
  .navbar .brand { font-size: 1.05rem; }
  .navbar > .container { flex-wrap: wrap; row-gap: 10px; justify-content: center; }
  .nav-actions { gap: 10px; width: 100%; justify-content: center; }
  .nav-actions .btn { padding: 9px 14px; font-size: 0.82rem; }
  .hero { padding: 60px 0 50px; }
  .hero h1 { font-size: 1.55rem; }
  .hero p.lead { font-size: 1rem; }
  .badge { font-size: 0.72rem; padding: 5px 12px; }
  .hero-card { padding: 20px; }
  .hero-card .card-amount { font-size: 1.8rem; }
  .stat-row { gap: 22px; }
  .section { padding: 50px 0; }
  .section-head h2 { font-size: 1.6rem; }
  .cta-band h2 { font-size: 1.35rem; }
  .auth-card { padding: 28px 22px; }
  .auth-card .auth-title { font-size: 1.2rem; }
  .topbar h1 { font-size: 1.25rem; }
  .main-content { padding: 18px 14px; }
  .panel-block { padding: 18px; }
  .stat-card { padding: 18px; }
  .stat-card-value { font-size: 1.4rem; }
  .live-earnings-card { padding: 22px 18px; }
  .live-earnings-amount { font-size: 1.9rem; }
  .cards-grid { gap: 14px; }
}
