/* ============================================================
   Smart Recycling — Design System  |  "Waste Not Wasted"
   Brand palette: Cal Poly Pomona Green, Muted Green,
                  Stratos Blue, Bit of Sugar
   Supports: dark mode (default) + light mode toggle
   ============================================================ */

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

/* ── Brand Tokens (static, never change with theme) ────────── */
:root {
  --brand-dark-green:   #21522e;   /* Cal Poly Pomona Green */
  --brand-mid-green:    #63a556;   /* Muted Green */
  --brand-blue:         #3a97c7;   /* Stratos Blue */
  --brand-off-white:    #f7f6f2;   /* Bit of Sugar */

  --clr-gold:    #f59e0b;
  --clr-silver:  #94a3b8;
  --clr-bronze:  #b45309;
  --clr-danger:  #ef4444;
  --clr-warning: #f59e0b;

  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-xl:   24px;
  --radius-full: 9999px;
  --sidebar-w:   268px;
  --transition:  0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ── DARK MODE (default) ────────────────────────────────────── */
:root, [data-theme="dark"] {
  color-scheme: dark;

  --clr-bg:        #0d1f12;
  --clr-surface:   #142018;
  --clr-surface-2: #1a2c1f;
  --clr-surface-3: #203526;
  --clr-border:    rgba(99,165,86,0.14);
  --clr-border-glow: rgba(99,165,86,0.38);

  --clr-primary:    #63a556;   /* Muted Green — main interactive */
  --clr-primary-dk: #21522e;   /* Dark green — hover */
  --clr-primary-lt: #7ec070;   /* Lighter tint */
  --clr-accent:     #3a97c7;   /* Stratos Blue — accent / teal */
  --clr-teal:       #3a97c7;
  --clr-purple:     #818cf8;

  --clr-text:       #e8ede9;
  --clr-text-muted: #9ab89d;
  --clr-text-dim:   #5a7d5e;

  --clr-success: #63a556;
  --clr-info:    #3a97c7;

  --shadow-sm:   0 2px 8px  rgba(0,0,0,0.5);
  --shadow-md:   0 4px 24px rgba(0,0,0,0.6);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.7);
  --shadow-glow: 0 0 32px rgba(99,165,86,0.18);
  --shadow-blue: 0 0 32px rgba(58,151,199,0.18);
}

/* ── LIGHT MODE ─────────────────────────────────────────────── */
[data-theme="light"] {
  color-scheme: light;

  --clr-bg:        #f7f6f2;   /* Bit of Sugar */
  --clr-surface:   #ffffff;
  --clr-surface-2: #eef4ef;
  --clr-surface-3: #e0ecdf;
  --clr-border:    rgba(33,82,46,0.14);
  --clr-border-glow: rgba(33,82,46,0.35);

  --clr-primary:    #21522e;   /* Cal Poly Pomona Green */
  --clr-primary-dk: #142018;
  --clr-primary-lt: #63a556;
  --clr-accent:     #3a97c7;
  --clr-teal:       #3a97c7;
  --clr-purple:     #6366f1;

  --clr-text:       #0d1f12;
  --clr-text-muted: #3d6b42;
  --clr-text-dim:   #7a9e7f;

  --clr-success: #21522e;
  --clr-info:    #3a97c7;

  --shadow-sm:   0 2px 8px  rgba(33,82,46,0.08);
  --shadow-md:   0 4px 24px rgba(33,82,46,0.12);
  --shadow-lg:   0 8px 40px rgba(33,82,46,0.16);
  --shadow-glow: 0 0 32px rgba(99,165,86,0.14);
  --shadow-blue: 0 0 32px rgba(58,151,199,0.14);
}

/* ── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--clr-bg);
  color: var(--clr-text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--clr-surface); }
::-webkit-scrollbar-thumb { background: var(--clr-primary-dk); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--clr-primary); }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--clr-text);
}
h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 2.5vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }
h4 { font-size: 1.1rem; }

p { color: var(--clr-text-muted); }
a { color: var(--clr-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--clr-primary-lt); }

/* ── Layout ─────────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 32px;
  max-width: 100%;
  transition: margin-left var(--transition);
}

@media (max-width: 900px) { .main-content { margin-left: 0; padding: 20px; } }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--clr-surface);
  border-right: 1px solid var(--clr-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition), background var(--transition);
}

/* Logo area */
.sidebar-logo {
  padding: 22px 20px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--clr-border);
  text-decoration: none;
}

.sidebar-logo .logo-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--brand-dark-green);
}

.sidebar-logo .logo-icon svg { width: 26px; height: 26px; }

.sidebar-logo .logo-wordmark {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--clr-text);
}
.sidebar-logo .logo-wordmark span { color: var(--clr-primary); }
.sidebar-logo .logo-tagline {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clr-accent);
  margin-top: 2px;
}

/* Logo image — keep natural colours, add subtle padding */
.sidebar-logo img {
  display: block;
  width: 100%;
  max-width: 188px;
  height: auto;
}

/* Dark mode: the logo has a light background (off-white) so add a subtle
   background pill so it doesn't look odd on dark surfaces */
[data-theme="dark"] .sidebar-logo img {
  background: rgba(247,246,242,0.92);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

/* Auth page logo: also needs a light background pill in dark mode */
[data-theme="dark"] .auth-logo img {
  background: rgba(247,246,242,0.92);
  border-radius: var(--radius-md);
  padding: 10px 16px;
}

/* Theme toggle in sidebar */
.theme-toggle-wrap {
  padding: 12px 16px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--clr-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.theme-toggle {
  position: relative;
  width: 42px; height: 22px;
  cursor: pointer;
}

.theme-toggle input { opacity: 0; width: 0; height: 0; }

.theme-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--clr-surface-3);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-full);
  transition: background var(--transition);
}

.theme-toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--clr-text-dim);
  transition: all var(--transition);
}

.theme-toggle input:checked + .theme-toggle-slider {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
}
.theme-toggle input:checked + .theme-toggle-slider::before {
  left: 24px;
  background: #fff;
}

.theme-toggle-icon {
  font-size: 0.9rem;
  color: var(--clr-text-dim);
}

/* Nav */
.sidebar-section { padding: 18px 14px 6px; }

.sidebar-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clr-text-dim);
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--clr-text-muted);
  font-size: 0.87rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  margin-bottom: 2px;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--clr-surface-2);
  color: var(--clr-text);
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(99,165,86,0.18), rgba(58,151,199,0.08));
  color: var(--clr-primary);
  border: 1px solid rgba(99,165,86,0.22);
}

[data-theme="light"] .nav-item.active {
  background: linear-gradient(135deg, rgba(33,82,46,0.1), rgba(58,151,199,0.05));
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--clr-primary);
  border-radius: 0 4px 4px 0;
}

.nav-item i { font-size: 1.05rem; width: 20px; text-align: center; }

.nav-item .badge {
  margin-left: auto;
  background: var(--clr-accent);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.sidebar-bottom {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--clr-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  text-decoration: none;
  transition: all var(--transition);
}
.sidebar-user:hover { border-color: var(--clr-border-glow); }

/* Avatars */
.avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand-dark-green), var(--brand-mid-green));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  flex-shrink: 0;
}

.avatar-lg {
  width: 72px; height: 72px;
  font-size: 1.6rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand-dark-green), var(--brand-mid-green));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: #fff;
  margin: 0 auto 12px;
  box-shadow: var(--shadow-glow);
}

.user-name { font-size: 0.82rem; font-weight: 600; color: var(--clr-text); }
.user-pts  { font-size: 0.7rem; color: var(--clr-primary); font-weight: 600; }

/* ── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--clr-border-glow);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

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

.card-title {
  font-size: 0.84rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clr-text-muted);
}

/* ── Stat Cards ──────────────────────────────────────────────── */
.stat-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--transition);
}
.stat-card:hover {
  border-color: var(--clr-border-glow);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon-green  { background: rgba(99,165,86,0.14);  color: var(--brand-mid-green); }
.stat-icon-teal   { background: rgba(58,151,199,0.14); color: var(--brand-blue); }
.stat-icon-gold   { background: rgba(245,158,11,0.14); color: var(--clr-gold); }
.stat-icon-purple { background: rgba(129,140,248,0.14);color: #818cf8; }

[data-theme="light"] .stat-icon-green  { background: rgba(33,82,46,0.1); color: var(--brand-dark-green); }
[data-theme="light"] .stat-icon-teal   { background: rgba(58,151,199,0.1); }

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--clr-text);
  line-height: 1;
}
.stat-label { font-size: 0.78rem; color: var(--clr-text-muted); font-weight: 500; margin-top: 4px; }

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.stat-change.up      { background: rgba(99,165,86,0.12); color: var(--clr-primary); }
.stat-change.down    { background: rgba(239,68,68,0.12); color: var(--clr-danger); }
.stat-change.neutral { background: rgba(100,116,139,0.12); color: var(--clr-text-dim); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand-dark-green);
  color: #fff;
  box-shadow: 0 4px 16px rgba(33,82,46,0.3);
}
.btn-primary:hover {
  background: var(--brand-mid-green);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(99,165,86,0.35);
  color: #fff;
}

.btn-secondary {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  color: var(--clr-text);
}
.btn-secondary:hover {
  background: var(--clr-surface-3);
  border-color: var(--clr-border-glow);
  color: var(--clr-text);
}

.btn-blue {
  background: var(--brand-blue);
  color: #fff;
  box-shadow: 0 4px 16px rgba(58,151,199,0.3);
}
.btn-blue:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  color: #fff;
}

.btn-danger {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--clr-danger);
}
.btn-danger:hover { background: rgba(239,68,68,0.22); color: var(--clr-danger); }

.btn-sm   { padding: 6px 14px; font-size: 0.78rem; }
.btn-lg   { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--clr-text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  color: var(--clr-text);
  padding: 12px 16px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(99,165,86,0.14);
}
[data-theme="light"] .form-control:focus {
  box-shadow: 0 0 0 3px rgba(33,82,46,0.1);
}
.form-control::placeholder { color: var(--clr-text-dim); }

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239ab89d' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-hint { font-size: 0.75rem; color: var(--clr-text-dim); margin-top: 6px; }
.form-check { display: flex; align-items: center; gap: 10px; }
.form-check input[type="checkbox"] { accent-color: var(--clr-primary); width: 16px; height: 16px; cursor: pointer; }
.form-check label { font-size: 0.85rem; color: var(--clr-text-muted); cursor: pointer; }

/* ── Auth Pages ─────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 20% 50%, rgba(33,82,46,0.1) 0%, transparent 55%),
              radial-gradient(ellipse at 80% 20%, rgba(58,151,199,0.07) 0%, transparent 55%),
              var(--clr-bg);
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 448px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: slideUp 0.4s ease;
}

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

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
}

.auth-logo-icon {
  width: 52px; height: 52px;
  background: var(--brand-dark-green);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 24px rgba(33,82,46,0.3);
}

/* ── Alerts / Flash ─────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert-success { background: rgba(99,165,86,0.12);  border: 1px solid rgba(99,165,86,0.3);  color: var(--clr-primary); }
.alert-danger  { background: rgba(239,68,68,0.12);  border: 1px solid rgba(239,68,68,0.3);  color: var(--clr-danger); }
.alert-warning { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3); color: var(--clr-gold); }
.alert-info    { background: rgba(58,151,199,0.12); border: 1px solid rgba(58,151,199,0.3); color: var(--brand-blue); }
.alert-close   { margin-left: auto; cursor: pointer; background: none; border: none; color: inherit; font-size: 1.1rem; }

[data-theme="light"] .alert-success { background: rgba(33,82,46,0.08); color: var(--brand-dark-green); }

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title { margin-bottom: 4px; }
.page-subtitle { font-size: 0.85rem; color: var(--clr-text-muted); }

/* ── Grid Layouts ────────────────────────────────────────────── */
.grid       { display: grid; gap: 20px; }
.grid-2     { grid-template-columns: repeat(2, 1fr); }
.grid-3     { grid-template-columns: repeat(3, 1fr); }
.grid-4     { grid-template-columns: repeat(4, 1fr); }
.grid-stats { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px)  { .grid-3, .grid-4, .grid-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .grid-2, .grid-3, .grid-4, .grid-stats { grid-template-columns: 1fr; } }

/* ── Progress Bar ────────────────────────────────────────────── */
.progress {
  height: 8px;
  background: var(--clr-surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-dark-green), var(--brand-mid-green));
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
}
.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Tables ──────────────────────────────────────────────────── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--clr-border);
}
table { width: 100%; border-collapse: collapse; }
thead { background: var(--clr-surface-2); border-bottom: 1px solid var(--clr-border); }
th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clr-text-dim);
  white-space: nowrap;
}
td {
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--clr-text-muted);
  border-bottom: 1px solid var(--clr-border);
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--clr-surface-2); }

/* ── Badge Pills ─────────────────────────────────────────────── */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green  { background: rgba(99,165,86,0.14); color: var(--brand-mid-green); border: 1px solid rgba(99,165,86,0.25); }
.badge-blue   { background: rgba(58,151,199,0.14);color: var(--brand-blue);      border: 1px solid rgba(58,151,199,0.25); }
.badge-red    { background: rgba(239,68,68,0.12); color: var(--clr-danger);      border: 1px solid rgba(239,68,68,0.2); }
.badge-yellow { background: rgba(245,158,11,0.12);color: var(--clr-gold);        border: 1px solid rgba(245,158,11,0.2); }
.badge-gray   { background: rgba(100,116,139,0.1);color: var(--clr-text-dim);    border: 1px solid rgba(100,116,139,0.15); }

/* ── Achievement Badges ──────────────────────────────────────── */
.achievement-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 20px 16px;
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}
.achievement-badge:hover { transform: translateY(-4px); box-shadow: var(--shadow-glow); border-color: var(--clr-border-glow); }
.achievement-badge .badge-name { font-size: 0.78rem; font-weight: 700; color: var(--clr-text); }
.achievement-badge .badge-desc { font-size: 0.68rem; color: var(--clr-text-dim); }

/* ── Leaderboard ─────────────────────────────────────────────── */
.leaderboard-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  border: 1px solid transparent;
}
.leaderboard-row:hover { background: var(--clr-surface-2); border-color: var(--clr-border); }
.leaderboard-row.current-user { background: rgba(99,165,86,0.07); border-color: rgba(99,165,86,0.25); }
.leaderboard-row.rank-1 { background: rgba(245,158,11,0.06); border-color: rgba(245,158,11,0.2); }
.leaderboard-row.rank-2 { background: rgba(148,163,184,0.06); border-color: rgba(148,163,184,0.2); }
.leaderboard-row.rank-3 { background: rgba(180,83,9,0.06); border-color: rgba(180,83,9,0.2); }

.rank-number { width: 36px; text-align: center; font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.1rem; flex-shrink: 0; }
.rank-1 .rank-number { color: var(--clr-gold); }
.rank-2 .rank-number { color: var(--clr-silver); }
.rank-3 .rank-number { color: var(--clr-bronze); }
.leaderboard-pts { margin-left: auto; font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 1rem; color: var(--clr-primary); white-space: nowrap; }

/* ── Voucher Cards ───────────────────────────────────────────── */
.voucher-card {
  background: linear-gradient(135deg, var(--clr-surface-2), var(--clr-surface-3));
  border: 1px dashed var(--clr-border-glow);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex; align-items: center; gap: 20px;
  transition: all var(--transition);
  position: relative; overflow: hidden;
}
.voucher-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(99,165,86,0.04), transparent);
  pointer-events: none;
}
.voucher-card:hover { border-color: var(--clr-primary); box-shadow: var(--shadow-glow); }
.voucher-value { font-family: 'Outfit', sans-serif; font-size: 2rem; font-weight: 800; color: var(--clr-primary); white-space: nowrap; }
.voucher-code {
  font-family: 'Courier New', monospace; font-size: 0.9rem; font-weight: 700;
  color: var(--clr-text); background: var(--clr-surface); padding: 4px 10px;
  border-radius: var(--radius-sm); border: 1px solid var(--clr-border); letter-spacing: 0.1em;
}

/* ── Product Cards ───────────────────────────────────────────── */
.product-card {
  background: var(--clr-surface); border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg); overflow: hidden; transition: all var(--transition);
}
.product-card:hover { transform: translateY(-4px); border-color: var(--clr-border-glow); box-shadow: var(--shadow-glow); }
.product-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--clr-surface-2); }
.product-img-placeholder { width: 100%; aspect-ratio: 16/9; background: var(--clr-surface-2); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.product-body { padding: 16px; }
.product-pts { display: flex; align-items: center; gap: 6px; font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--clr-primary); margin-top: 8px; }

/* ── Map ─────────────────────────────────────────────────────── */
#map { width: 100%; height: 500px; border-radius: var(--radius-lg); border: 1px solid var(--clr-border); overflow: hidden; background: var(--clr-surface-2); }

/* ── Points Badge ────────────────────────────────────────────── */
.points-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: rgba(99,165,86,0.12);
  border: 1px solid rgba(99,165,86,0.28);
  border-radius: var(--radius-full);
  font-size: 0.875rem; font-weight: 700; color: var(--clr-primary);
}
[data-theme="light"] .points-badge { background: rgba(33,82,46,0.08); border-color: rgba(33,82,46,0.2); }

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 0 28px; margin-bottom: 8px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

/* ── Animations ──────────────────────────────────────────────── */
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,165,86,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(99,165,86,0); }
}
.pulse { animation: pulse-green 2s infinite; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
.float { animation: float 3s ease-in-out infinite; }

/* ── Mobile Menu Toggle ──────────────────────────────────────── */
.menu-toggle {
  display: none;
  position: fixed; top: 20px; left: 20px;
  z-index: 200;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: 10px;
  cursor: pointer;
  color: var(--clr-text);
  font-size: 1.2rem;
}
@media (max-width: 900px) {
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 99; }
  .sidebar-overlay.visible { display: block; }
  .main-content { padding: 24px 16px 16px; }
}

/* ── Utilities ───────────────────────────────────────────────── */
.text-primary  { color: var(--clr-primary) !important; }
.text-muted    { color: var(--clr-text-muted) !important; }
.text-dim      { color: var(--clr-text-dim) !important; }
.text-gold     { color: var(--clr-gold) !important; }
.text-teal     { color: var(--clr-accent) !important; }
.text-danger   { color: var(--clr-danger) !important; }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.text-sm       { font-size: 0.8rem; }
.text-xs       { font-size: 0.7rem; }
.text-lg       { font-size: 1.1rem; }
.font-bold     { font-weight: 700; }
.font-semibold { font-weight: 600; }

.mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.p-0 { padding: 0 !important; } .p-3 { padding: 24px; } .p-4 { padding: 32px; } .p-5 { padding: 48px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }

.divider { height: 1px; background: var(--clr-border); margin: 20px 0; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--clr-text-dim); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 300;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--clr-surface); border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl); padding: 32px;
  max-width: 480px; width: 100%;
  animation: slideUp 0.3s ease;
  box-shadow: var(--shadow-lg);
}

/* ── Chart Container ─────────────────────────────────────────── */
.chart-wrapper { position: relative; height: 240px; width: 100%; }

/* ── Glow Decorations ────────────────────────────────────────── */
.glow-orb {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,165,86,0.14), transparent 70%);
  pointer-events: none; z-index: 0;
}

/* ── Brand accent stripe ─────────────────────────────────────── */
.brand-stripe {
  height: 4px;
  background: linear-gradient(90deg, var(--brand-dark-green), var(--brand-mid-green), var(--brand-blue));
  border-radius: var(--radius-full);
}

/* ── Card body helpers ────────────────────────────────────────── */
.card-body { /* no default padding — inherits from .card */ }
.card-glass {
  background: rgba(20,32,24,0.72);
  backdrop-filter: blur(16px);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
[data-theme="light"] .card-glass { background: rgba(247,246,242,0.88); }

/* ── Accent colour override helpers ──────────────────────────── */
.accent-green { --clr-accent: var(--brand-mid-green); }
.accent-blue  { --clr-accent: var(--brand-blue); }

/* stat-change aliases used in templates */
.positive { background: rgba(99,165,86,0.12); color: var(--clr-primary); }
.negative { background: rgba(239,68,68,0.12); color: var(--clr-danger); }

/* ── Table helper ────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table thead { background: var(--clr-surface-2); border-bottom: 1px solid var(--clr-border); }
.table th { padding: 12px 16px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--clr-text-dim); white-space: nowrap; text-align: left; }
.table td { padding: 14px 16px; font-size: 0.875rem; color: var(--clr-text-muted); border-bottom: 1px solid var(--clr-border); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--clr-surface-2); }

/* ── mr/ml helpers used in templates ────────────────────────── */
.mr-1 { margin-right: 4px; } .mr-2 { margin-right: 8px; }
.ml-1 { margin-left: 4px; }  .ml-2 { margin-left: 8px; }
