:root {
  --zh-primary: #16a34a;
  --zh-primary-dark: #15803d;
  --zh-primary-light: #dcfce7;
  --zh-accent: #f59e0b;
  --zh-accent-light: #fef3c7;
  --zh-bg: #f8fafc;
  --zh-surface: #ffffff;
  --zh-text: #0f172a;
  --zh-muted: #64748b;
  --zh-border: #e2e8f0;
  --zh-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --zh-radius: 16px;
  --zh-sidebar-width: 260px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  background: var(--zh-bg);
  color: var(--zh-text);
  min-height: 100vh;
}

a {
  text-decoration: none;
}

.btn-primary {
  background: var(--zh-primary);
  border-color: var(--zh-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--zh-primary-dark);
  border-color: var(--zh-primary-dark);
}

.text-primary {
  color: var(--zh-primary) !important;
}

.bg-primary {
  background: var(--zh-primary) !important;
}

.badge-reward {
  background: var(--zh-accent-light);
  color: #92400e;
  font-weight: 600;
}

/* Auth pages */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.auth-hero {
  background: linear-gradient(135deg, #15803d 0%, #16a34a 45%, #059669 100%);
  color: #fff;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.15), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.1), transparent 35%);
}

.auth-hero-content {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.glass-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--zh-radius);
  box-shadow: var(--zh-shadow);
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.trust-badge {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
}

/* App layout */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--zh-sidebar-width);
  background: var(--zh-surface);
  border-right: 1px solid var(--zh-border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--zh-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-brand .logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--zh-primary), #059669);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.sidebar-nav {
  padding: 1rem 0.75rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  color: var(--zh-muted);
  margin-bottom: 0.25rem;
  transition: all 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: var(--zh-primary-light);
  color: var(--zh-primary-dark);
}

.main-content {
  margin-left: var(--zh-sidebar-width);
  flex: 1;
  min-width: 0;
}

.topbar {
  background: var(--zh-surface);
  border-bottom: 1px solid var(--zh-border);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.page-content {
  padding: 1.5rem;
}

.card-modern {
  border: 1px solid var(--zh-border);
  border-radius: var(--zh-radius);
  box-shadow: var(--zh-shadow);
  background: var(--zh-surface);
}

.balance-hero {
  background: linear-gradient(135deg, #15803d, #16a34a 55%, #059669);
  color: #fff;
  border: none;
  overflow: hidden;
  position: relative;
}

.balance-hero::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.quick-tile {
  border: 1px solid var(--zh-border);
  border-radius: var(--zh-radius);
  padding: 1.25rem;
  background: var(--zh-surface);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.quick-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--zh-shadow);
}

.quick-tile .icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--zh-primary-light);
  color: var(--zh-primary-dark);
  margin-bottom: 0.75rem;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--zh-muted);
  font-size: 0.85rem;
}

.earn-card {
  border: 1px solid var(--zh-border);
  border-radius: var(--zh-radius);
  overflow: hidden;
  transition: transform 0.2s ease;
}

.earn-card:hover {
  transform: translateY(-2px);
}

.earn-card .reward-chip {
  background: var(--zh-accent-light);
  color: #92400e;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.stepper {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.stepper-item {
  flex: 1;
  text-align: center;
  padding: 0.75rem;
  border-radius: 12px;
  background: #f1f5f9;
  color: var(--zh-muted);
  font-size: 0.85rem;
}

.stepper-item.active {
  background: var(--zh-primary-light);
  color: var(--zh-primary-dark);
  font-weight: 600;
}

.stepper-item.done {
  background: #ecfdf5;
  color: #047857;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--zh-muted);
}

.empty-state i {
  font-size: 2.5rem;
  color: #cbd5e1;
  margin-bottom: 0.75rem;
}

.confetti-burst {
  animation: pop 0.6s ease;
}

@keyframes pop {
  0% {
    transform: scale(0.95);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.notification-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
}

@media (max-width: 991px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    min-height: 220px;
    padding: 2rem;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }
}
