/* ═══════════════════════════════════════════════════════════════
   Carby Control — Premium Dark Theme
   Carbon Footprint Web Application
   ═══════════════════════════════════════════════════════════════ */

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

/* ── CSS Variables — Colourful Natural Theme ─────────────────────── */
:root {
  --bg-primary:      #f0f4ef;
  --bg-secondary:    #e8f0e5;
  --bg-card:         #ffffff;
  --bg-card-hover:   #f7faf6;
  --glass-bg:        rgba(45, 106, 79, 0.06);
  --glass-border:    rgba(45, 106, 79, 0.15);

  --accent-green:    #2D6A4F;
  --accent-teal:     #40916C;
  --accent-blue:     #1A759F;
  --accent-purple:   #7B2D8B;
  --accent-pink:     #E76F51;
  --accent-yellow:   #E9C46A;
  --accent-orange:   #F4A261;

  --text-primary:    #1B2D1F;
  --text-secondary:  #4A6741;
  --text-muted:      #7A9E7E;

  --danger:          #E63946;
  --warning:         #F4A261;
  --success:         #2D6A4F;
  --info:            #1A759F;

  --sidebar-width:   260px;
  --topbar-h:        64px;
  --radius:          14px;
  --radius-sm:       8px;
  --radius-lg:       20px;

  --shadow-sm:  0 2px 8px rgba(45,106,79,0.1);
  --shadow-md:  0 8px 24px rgba(45,106,79,0.15);
  --shadow-lg:  0 16px 48px rgba(45,106,79,0.2);
  --shadow-glow-green:  0 0 24px rgba(45,106,79,0.2);
  --shadow-glow-blue:   0 0 24px rgba(26,117,159,0.2);

  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

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

a { color: var(--accent-green); text-decoration: none; transition: color var(--transition); }
a:hover { color: #40916C; }

img { max-width: 100%; }

/* ══════════════════════════════════════════════════════════════════
   LAYOUT — Sidebar + Main
   ══════════════════════════════════════════════════════════════════ */

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #1B4332 0%, #2D6A4F 50%, #40916C 100%);
  border-right: none;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition), width var(--transition);
  box-shadow: 4px 0 24px rgba(27,67,50,0.25);
}

.sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-width))); }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.logo-icon {
  font-size: 28px;
  color: #E9C46A;
  filter: drop-shadow(0 0 8px rgba(233,196,106,0.6));
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #E9C46A, #F4A261);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

/* ── Sidebar Navigation ─────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #E9C46A;
  border-radius: 0 4px 4px 0;
  transform: scaleY(0);
  transition: transform var(--transition);
}

.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.nav-item.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-weight: 700;
}

.nav-item.active::before { transform: scaleY(1); }

.nav-item .material-icons-round { font-size: 20px; }

/* ── Sidebar Footer ─────────────────────────────────────────────── */
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E9C46A, #F4A261);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  color: #1B2D1F;
  flex-shrink: 0;
}

.user-details { display: flex; flex-direction: column; min-width: 0; }
.user-name  { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.95); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; color: rgba(255,255,255,0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.logout-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.55);
  transition: all var(--transition);
  flex-shrink: 0;
}
.sidebar-footer form { margin: 0; }
.logout-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
}
.logout-btn:hover { background: rgba(230,57,70,0.2); color: #E63946; }

/* ── Main Wrapper ───────────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition);
}

.main-wrapper.expanded { margin-left: 0; }

/* ── Topbar ─────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  background: rgba(240,244,239,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(45,106,79,0.12);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  box-shadow: 0 2px 12px rgba(45,106,79,0.08);
}

.menu-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-secondary); border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.menu-toggle:hover { background: var(--glass-bg); color: var(--text-primary); }

.topbar-title {
  flex: 1;
  font-size: 18px; font-weight: 700;
  color: var(--text-primary);
}

.topbar-date {
  font-size: 13px; color: var(--text-muted);
  background: var(--glass-bg);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
}

/* ── Page Content ───────────────────────────────────────────────── */
.page-content {
  padding: 28px 28px 48px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Flash Messages ─────────────────────────────────────────────── */
.flash-container {
  padding: 12px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-flash { position: fixed; top: 20px; right: 20px; z-index: 9999; width: 360px; }

.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  animation: slideIn 0.3s ease;
  transition: opacity 0.4s;
  border: 1px solid;
}

.flash-success { background: rgba(45,106,79,0.12); border-color: rgba(45,106,79,0.3); color: #2D6A4F; }
.flash-danger  { background: rgba(230,57,70,0.12); border-color: rgba(230,57,70,0.3); color: #E63946; }
.flash-info    { background: rgba(26,117,159,0.12);  border-color: rgba(26,117,159,0.3);  color: #1A759F; }
.flash-warning { background: rgba(244,162,97,0.12);  border-color: rgba(244,162,97,0.3);  color: #F4A261; }

.flash-icon { font-size: 18px !important; }
.flash-close {
  margin-left: auto; background: transparent; border: none; cursor: pointer;
  color: inherit; opacity: 0.6; display: flex; align-items: center;
  transition: opacity var(--transition);
}
.flash-close:hover { opacity: 1; }
.flash-close .material-icons-round { font-size: 16px !important; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════════
   COMPONENTS
   ══════════════════════════════════════════════════════════════════ */

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}
.card:hover { border-color: rgba(45,106,79,0.3); box-shadow: var(--shadow-sm); }

.card-header {
  display: flex; align-items: center;
  gap: 8px;
  padding: 16px 20px;
  font-size: 14px; font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--glass-border);
}
.card-header .material-icons-round { font-size: 18px; color: var(--accent-green); }

.card-action {
  margin-left: auto; font-size: 12px; font-weight: 500;
  color: var(--accent-green); padding: 4px 10px;
  border-radius: 20px; background: rgba(45,106,79,0.1);
  transition: all var(--transition);
}
.card-action:hover { background: rgba(45,106,79,0.2); color: #2D6A4F; }

/* ── Stat Cards ─────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }

.stat-card {
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: center;
  gap: 16px;
  border: 1px solid var(--glass-border);
  transition: all var(--transition);
  position: relative; overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-card-green { background: linear-gradient(135deg, #d8f3dc, #ffffff); }
.stat-card-green::after { background: linear-gradient(90deg, #2D6A4F, #40916C); }

.stat-card-blue { background: linear-gradient(135deg, #caf0f8, #ffffff); }
.stat-card-blue::after { background: linear-gradient(90deg, #1A759F, #48CAE4); }

.stat-card-purple { background: linear-gradient(135deg, #ede0f5, #ffffff); }
.stat-card-purple::after { background: linear-gradient(90deg, #7B2D8B, #b57bee); }

.stat-card-teal { background: linear-gradient(135deg, #d0f4ea, #ffffff); }
.stat-card-teal::after { background: linear-gradient(90deg, #40916C, #74c69d); }

.stat-card-red { background: linear-gradient(135deg, #fde8e8, #ffffff); }
.stat-card-red::after { background: linear-gradient(90deg, #E63946, #ff7b84); }

.stat-card-orange { background: linear-gradient(135deg, #fdebd0, #ffffff); }
.stat-card-orange::after { background: linear-gradient(90deg, #F4A261, #E9C46A); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass-bg);
  flex-shrink: 0;
}
.stat-icon .material-icons-round { font-size: 24px; color: var(--text-secondary); }

.stat-card-green .stat-icon .material-icons-round { color: var(--accent-green); }
.stat-card-blue   .stat-icon .material-icons-round { color: var(--accent-blue); }
.stat-card-purple .stat-icon .material-icons-round { color: var(--accent-purple); }
.stat-card-teal   .stat-icon .material-icons-round { color: var(--accent-teal); }
.stat-card-red    .stat-icon .material-icons-round { color: var(--danger); }
.stat-card-orange .stat-icon .material-icons-round { color: var(--warning); }

.stat-body { flex: 1; min-width: 0; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-weight: 500; }

.stat-badge {
  opacity: 0.15;
  font-size: 36px;
}
.stat-badge .material-icons-round { font-size: 36px; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 600;
  border: none; cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #2D6A4F, #40916C);
  color: #ffffff;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(45,106,79,0.4);
  color: #ffffff;
  background: linear-gradient(135deg, #1B4332, #2D6A4F);
}

.btn-success {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(22,163,74,0.35);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(45,106,79,0.4);
  color: var(--accent-green);
}
.btn-outline:hover { border-color: var(--accent-green); color: #1B4332; background: rgba(45,106,79,0.08); }

.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--glass-bg); color: var(--text-primary); }

.btn-lg { padding: 13px 28px; font-size: 15px; border-radius: var(--radius-sm); }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; margin-top: 8px; }

.btn .material-icons-round { font-size: 18px; }
.btn-lg .material-icons-round { font-size: 20px; }

/* Icon button */
.btn-icon {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); transition: all var(--transition);
}
.btn-icon:hover { background: var(--glass-bg); color: var(--text-secondary); }
.btn-icon-danger:hover { background: rgba(248,113,113,0.15); color: var(--danger); }
.btn-icon .material-icons-round { font-size: 17px !important; }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-group {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 18px;
}

.form-group label {
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
}

.form-group label small {
  font-weight: 400; color: var(--text-muted);
}

.input-wrapper {
  position: relative; display: flex; align-items: center;
}

.input-icon {
  position: absolute; left: 12px;
  font-size: 18px !important; color: var(--text-muted);
  pointer-events: none;
}

.input-suffix {
  position: absolute; right: 12px;
  font-size: 12px; color: var(--text-muted); font-weight: 500;
  pointer-events: none;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%; padding: 11px 14px 11px 42px;
  background: var(--bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: all var(--transition);
  outline: none;
}

input[type="number"] { padding-right: 60px; }
input[type="date"]   { padding-right: 14px; color-scheme: light; }

input:focus, textarea:focus, select:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(45,106,79,0.15);
}

textarea {
  resize: vertical; min-height: 90px;
  padding: 11px 14px 11px 42px;
}

.password-toggle {
  position: absolute; right: 12px;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); display: flex; align-items: center;
  transition: color var(--transition);
}
.password-toggle:hover { color: var(--text-secondary); }
.password-toggle .material-icons-round { font-size: 18px !important; }

/* Password strength */
.strength-bar {
  height: 4px; border-radius: 4px;
  background: var(--glass-bg); margin-top: 6px; overflow: hidden;
}
.strength-fill {
  height: 100%; border-radius: 4px; width: 0;
  transition: width 0.3s, background 0.3s;
}
.strength-label { font-size: 11px; color: var(--text-muted); }

/* Checkbox */
.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 13px; color: var(--text-secondary);
  user-select: none; margin-bottom: 16px;
}
.checkbox-label input[type="checkbox"] { display: none; }
.checkbox-custom {
  width: 16px; height: 16px;
  border: 1px solid var(--glass-border); border-radius: 4px;
  background: var(--bg-primary); flex-shrink: 0;
  position: relative; transition: all var(--transition);
}
.checkbox-label input:checked + .checkbox-custom {
  background: var(--accent-green);
  border-color: var(--accent-green);
}
.checkbox-label input:checked + .checkbox-custom::after {
  content: '';
  position: absolute; left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: 2px solid #0a0f14;
  border-left: none; border-top: none;
  transform: rotate(45deg);
}

/* ── Goal / Progress Bar ────────────────────────────────────────── */
.goal-bar-card .card-header,
.goal-management-card .card-header { padding-bottom: 12px; }

.goal-progress, .goal-management-card { padding: 16px 20px; }

.goal-labels {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-muted); margin-bottom: 8px;
}

.progress-track {
  height: 10px; border-radius: 10px;
  background: rgba(45,106,79,0.12);
  overflow: hidden;
}

.progress-fill {
  height: 100%; border-radius: 10px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
  min-width: 4px;
}
.fill-success { background: linear-gradient(90deg, #2D6A4F, #74c69d); }
.fill-warning { background: linear-gradient(90deg, #F4A261, #E9C46A); }
.fill-danger  { background: linear-gradient(90deg, #E63946, #F4A261); }

.goal-hint {
  font-size: 12px; color: var(--text-muted); margin-top: 10px;
}

.goal-form {
  display: flex; align-items: flex-end; gap: 12px; margin-top: 14px;
  flex-wrap: wrap;
}

/* ── Charts ─────────────────────────────────────────────────────── */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.chart-card { padding: 0; }
.chart-card-wide { grid-column: 1 / -1; }

.chart-container {
  padding: 16px 20px 20px;
  height: 280px;
}

.empty-chart {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-chart .material-icons-round { font-size: 48px; margin-bottom: 10px; display: block; }
.empty-chart p { font-size: 14px; margin-bottom: 16px; }

/* ── Entry / Log Lists ──────────────────────────────────────────── */
.entry-list, .log-list {
  display: flex; flex-direction: column;
}

.entry-item, .log-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--transition);
}
.entry-item:last-child, .log-row:last-child { border-bottom: none; }
.entry-item:hover, .log-row:hover { background: var(--glass-bg); }

.entry-icon, .log-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.entry-icon .material-icons-round,
.log-icon .material-icons-round { font-size: 20px !important; }

.entry-body, .log-body { flex: 1; min-width: 0; }

.entry-title, .log-cat {
  font-size: 14px; font-weight: 600; color: var(--text-primary);
}
.entry-meta, .log-note {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.log-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.entry-amount, .log-amount {
  font-size: 14px; font-weight: 700;
  color: var(--accent-green); white-space: nowrap;
}

.log-right {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

.badge {
  margin-left: auto;
  background: rgba(45,106,79,0.12);
  color: var(--accent-green);
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
}

/* ── Empty State ────────────────────────────────────────────────── */
.empty-state {
  padding: 48px 20px; text-align: center; color: var(--text-muted);
}
.empty-state .material-icons-round {
  font-size: 52px; margin-bottom: 12px; display: block; opacity: 0.4;
}
.empty-state p { font-size: 14px; }

/* ── Tracker Page Layout ────────────────────────────────────────── */
.tracker-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
  align-items: start;
}

.log-form-card { padding: 0; }
.log-form-card form { padding: 20px; }

/* Category pills */
.category-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
}

.pill-label { cursor: pointer; }
.pill-label input { display: none; }

.pill {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-primary);
  transition: all var(--transition);
}
.pill .material-icons-round { font-size: 16px !important; }

.pill-label input:checked + .pill {
  background: color-mix(in srgb, var(--pill-color) 15%, transparent);
  border-color: var(--pill-color);
  color: var(--pill-color);
  box-shadow: 0 0 12px color-mix(in srgb, var(--pill-color) 20%, transparent);
}

.pill:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* Reference guide */
.reference-guide {
  margin: 0 20px 20px;
  background: var(--bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.reference-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  margin-bottom: 10px;
}
.reference-title .material-icons-round { font-size: 15px !important; color: var(--accent-yellow); }

.reference-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.ref-item {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-muted);
  padding: 4px 0;
}
.ref-item strong { color: var(--text-secondary); }

.log-history-card { height: fit-content; }

/* ── Progress page specifics ────────────────────────────────────── */
.category-breakdown { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }

.breakdown-row { display: flex; align-items: center; gap: 12px; }

.breakdown-label {
  display: flex; align-items: center; gap: 6px;
  width: 90px; font-size: 12px; color: var(--text-secondary); flex-shrink: 0;
}
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.breakdown-bar-wrap { flex: 1; height: 8px; background: var(--glass-bg); border-radius: 8px; overflow: hidden; }
.breakdown-bar { height: 100%; border-radius: 8px; transition: width 0.8s ease; min-width: 4px; }

.breakdown-value { font-size: 12px; font-weight: 600; color: var(--text-primary); width: 72px; text-align: right; }

/* ── Reports page specifics ─────────────────────────────────────── */
.download-card { padding: 0; }
.download-desc { padding: 16px 20px 0; font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

.filter-row {
  display: flex; gap: 16px; padding: 16px 20px 8px;
  flex-wrap: wrap;
}
.filter-row .form-group { flex: 1; min-width: 160px; margin-bottom: 0; }

.download-buttons {
  display: flex; gap: 12px; padding: 12px 20px 20px;
  flex-wrap: wrap;
}

.summary-table-wrap { overflow-x: auto; padding: 0 0 4px; }

.summary-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}

.summary-table th {
  padding: 12px 20px;
  text-align: left; font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--glass-border);
}

.summary-table td {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary);
  vertical-align: middle;
}
.summary-table tr:hover td { background: var(--glass-bg); }
.summary-table .total-row td {
  font-size: 13px; color: var(--text-primary);
  border-top: 1px solid var(--glass-border);
  border-bottom: none;
}

.cat-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}

.mini-bar-wrap { height: 6px; background: var(--glass-bg); border-radius: 6px; overflow: hidden; }
.mini-bar { height: 100%; border-radius: 6px; }

/* ══════════════════════════════════════════════════════════════════
   AUTH PAGES
   ══════════════════════════════════════════════════════════════════ */

.auth-wrapper {
  min-height: 100vh;
  background: var(--bg-primary);
}

.auth-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* Left decorative panel */
.auth-panel-left {
  background: linear-gradient(135deg, #0d2918 0%, #0d1f32 50%, #1a0d32 100%);
  padding: 60px;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}

.auth-panel-left::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(74,222,128,0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(96,165,250,0.08) 0%, transparent 50%);
}

.auth-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 22px; font-weight: 800;
  color: var(--accent-green);
  margin-bottom: 48px; position: relative;
}
.auth-brand .material-icons-round { font-size: 28px; filter: drop-shadow(0 0 8px rgba(74,222,128,0.5)); }

.auth-panel-left h1 {
  font-size: 42px; font-weight: 800;
  line-height: 1.2; color: var(--text-primary);
  margin-bottom: 16px; position: relative;
}

.auth-panel-left p {
  font-size: 16px; color: var(--text-secondary);
  line-height: 1.7; position: relative;
  margin-bottom: 40px;
}

.auth-stats {
  display: flex; gap: 32px; position: relative;
}
.auth-stat-value { font-size: 26px; font-weight: 800; color: var(--accent-green); }
.auth-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.auth-features {
  list-style: none; display: flex; flex-direction: column; gap: 14px;
  position: relative;
}
.auth-features li {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; color: var(--text-secondary);
}
.auth-features li .material-icons-round { font-size: 18px; color: var(--accent-green); }

/* Right form panel */
.auth-panel-right {
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  background: var(--bg-primary);
}

.auth-card {
  width: 100%; max-width: 440px;
}

.auth-card h2 {
  font-size: 28px; font-weight: 800;
  color: var(--text-primary); margin-bottom: 6px;
}

.auth-card-subtitle {
  font-size: 14px; color: var(--text-muted); margin-bottom: 28px;
}

.form-row { margin-bottom: 16px; }

.auth-switch {
  text-align: center; font-size: 13px;
  color: var(--text-muted); margin-top: 20px;
}

.auth-back {
  display: flex; align-items: center; gap: 4px;
  justify-content: center; margin-top: 16px;
  font-size: 12px; color: var(--text-muted);
}
.auth-back:hover { color: var(--text-secondary); }
.auth-back .material-icons-round { font-size: 14px !important; }

.gradient-text {
  background: linear-gradient(135deg, #E9C46A, #F4A261, #E76F51);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ══════════════════════════════════════════════════════════════════
   LANDING PAGE
   ══════════════════════════════════════════════════════════════════ */

.landing-body {
  background: var(--bg-primary);
  overflow-x: hidden;
}

/* Navbar */
.landing-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 60px;
  background: rgba(15,25,20,0.75);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 800;
  color: #fff;
  -webkit-text-fill-color: #fff;
}
.nav-brand .material-icons-round {
  font-size: 26px; color: #E9C46A;
  -webkit-text-fill-color: #E9C46A;
  filter: drop-shadow(0 0 8px rgba(233,196,106,0.6));
}

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

/* Hero */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 120px 60px 80px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute; inset: 0; z-index: 0;
}

.orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px);
}
.orb-1 { width: 500px; height: 500px; top: -100px; left: -100px;
          background: radial-gradient(circle, rgba(74,222,128,0.12), transparent 70%); }
.orb-2 { width: 400px; height: 400px; bottom: 0; right: 100px;
          background: radial-gradient(circle, rgba(96,165,250,0.08), transparent 70%); }
.orb-3 { width: 300px; height: 300px; top: 50%; right: 30%;
          background: radial-gradient(circle, rgba(167,139,250,0.06), transparent 70%); }

.hero-content {
  position: relative; z-index: 1;
  max-width: 680px;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  background: rgba(233,196,106,0.15);
  border: 1px solid rgba(233,196,106,0.4);
  font-size: 12px; font-weight: 600; color: #E9C46A;
  margin-bottom: 24px;
}
.hero-badge .material-icons-round { font-size: 14px !important; }

.hero-title {
  font-size: 68px; font-weight: 900;
  line-height: 1.1; color: #ffffff;
  margin-bottom: 20px;
  letter-spacing: -1.5px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.hero-subtitle {
  font-size: 18px; color: rgba(255,255,255,0.85);
  line-height: 1.7; margin-bottom: 36px;
  max-width: 520px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.3);
}

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

/* Floating cards */
.hero-cards {
  position: absolute; right: 60px; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 16px;
  z-index: 1;
}

.hero-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  background: rgba(15,25,20,0.85);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  animation: float 4s ease-in-out infinite;
  min-width: 220px;
}
.hero-card .material-icons-round { font-size: 28px; }

.card-1 { animation-delay: 0s; }
.card-2 { animation-delay: 1.3s; }
.card-3 { animation-delay: 2.6s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.hc-value { font-size: 18px; font-weight: 700; color: #ffffff; }
.hc-label { font-size: 11px; color: rgba(255,255,255,0.6); margin-top: 2px; }

/* Features */
.features {
  padding: 100px 60px;
  background: var(--bg-secondary);
}

.section-title {
  font-size: 38px; font-weight: 800;
  text-align: center; color: var(--text-primary);
  margin-bottom: 56px; letter-spacing: -0.5px;
}

.features-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 24px; max-width: 1200px; margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all var(--transition);
}
.feature-card:hover {
  border-color: rgba(45,106,79,0.3);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--icon-color) 15%, transparent);
  margin-bottom: 18px;
}
.feature-icon .material-icons-round { font-size: 26px; color: var(--icon-color); }

.feature-card h3 {
  font-size: 16px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 10px;
}
.feature-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* Footer */
.landing-footer {
  padding: 40px 60px;
  border-top: 1px solid var(--glass-border);
  text-align: center;
}
.footer-brand {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 18px; font-weight: 700; color: var(--accent-green);
  margin-bottom: 12px;
}
.footer-brand .material-icons-round { font-size: 22px; }
.landing-footer p { font-size: 13px; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-cards    { display: none; }
  .hero-title    { font-size: 52px; }
  .tracker-layout { grid-template-columns: 1fr; }
  .stats-grid    { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .auth-container        { grid-template-columns: 1fr; }
  .auth-panel-left       { display: none; }
  .charts-row            { grid-template-columns: 1fr; }
  .landing-nav           { padding: 16px 24px; }
  .hero                  { padding: 100px 24px 60px; }
  .features              { padding: 60px 24px; }
  .landing-footer        { padding: 32px 24px; }
  .features-grid         { grid-template-columns: 1fr 1fr; }
  .page-content          { padding: 20px 16px 40px; }
}

@media (max-width: 640px) {
  .stats-grid     { grid-template-columns: 1fr 1fr; }
  .stats-grid-3   { grid-template-columns: 1fr; }
  .hero-title     { font-size: 38px; }
  .features-grid  { grid-template-columns: 1fr; }
  .filter-row     { flex-direction: column; }
  .download-buttons { flex-direction: column; }
  .sidebar        { transform: translateX(calc(-1 * var(--sidebar-width))); }
  .main-wrapper   { margin-left: 0; }
  .sidebar.mobile-open { transform: translateX(0); }
}

/* Landing calculator, analytics demo, and dashboard engagement */
.orb { display: none; }

.landing-section {
  padding: 88px 60px;
  background: var(--bg-primary);
}

.landing-section:nth-of-type(even) {
  background: var(--bg-secondary);
}

.landing-section-heading {
  max-width: 780px;
  margin: 0 auto 34px;
  text-align: center;
}

.section-kicker {
  color: var(--accent-blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.section-copy {
  color: var(--text-secondary);
  font-size: 15px;
  margin: -38px auto 0;
  max-width: 680px;
}

.calculator-demo-grid,
.insight-grid,
.offset-goal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.calculator-demo-grid,
.demo-dashboard-grid,
.engagement-grid,
.goal-demo-panel {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.demo-panel,
.engagement-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.demo-panel {
  overflow: hidden;
}

.demo-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
}

.demo-panel-header .material-icons-round {
  color: var(--accent-green);
  font-size: 20px;
}

.demo-calc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.demo-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.demo-field span {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 13px;
}

.demo-field small {
  color: var(--text-muted);
  font-size: 11px;
}

.demo-field input {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(45,106,79,0.18);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font: inherit;
  font-weight: 700;
  background: #fff;
}

.demo-total-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 18px 18px;
  padding: 16px;
  border-radius: var(--radius-sm);
  color: #fff;
  background: linear-gradient(135deg, #1B4332, #1A759F);
}

.demo-total-card span {
  font-size: 13px;
  opacity: 0.85;
}

.demo-total-card strong {
  font-size: 24px;
  line-height: 1.1;
  white-space: nowrap;
}

.recommendation-panel {
  display: flex;
  flex-direction: column;
}

.ai-suggestion {
  margin: 18px;
  padding: 16px;
  border-radius: var(--radius-sm);
  color: #1B4332;
  background: #d8f3dc;
  border: 1px solid rgba(45,106,79,0.2);
  font-weight: 700;
  line-height: 1.5;
}

.recommendation-table {
  display: flex;
  flex-direction: column;
  margin: 0 18px 18px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.recommendation-table > div {
  display: grid;
  grid-template-columns: 0.95fr 1.35fr;
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 13px;
}

.recommendation-table > div:first-child {
  color: var(--text-primary);
  background: var(--bg-primary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.recommendation-table > div:last-child {
  border-bottom: none;
}

.demo-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.landing-chart-box {
  height: 260px;
  padding: 16px;
}

.engagement-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.engagement-card {
  padding: 18px;
  min-height: 164px;
}

.engagement-card .material-icons-round {
  color: var(--accent-blue);
  font-size: 28px;
  margin-bottom: 12px;
}

.engagement-card strong {
  display: block;
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 8px;
}

.engagement-card p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.goal-demo-panel {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 20px;
  align-items: center;
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.goal-demo-panel h3 {
  color: var(--text-primary);
  font-size: 22px;
  margin: 0;
}

.goal-demo-progress {
  min-width: 0;
}

.insight-grid,
.offset-goal-grid {
  width: 100%;
}

.insight-card .insight-body {
  padding: 18px 20px 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.insight-lead {
  color: var(--text-primary);
  font-weight: 800;
  margin-bottom: 10px;
}

.dashboard-recommendations {
  margin: 18px 20px 20px;
}

.dashboard-engagement {
  max-width: none;
  width: 100%;
  margin-top: 0;
}

.offset-card {
  min-height: 164px;
}

.offset-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 20px 20px;
}

.offset-body > div {
  padding: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.offset-label {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.offset-body strong {
  color: var(--text-primary);
  font-size: 20px;
}

.compact-goal {
  padding: 18px 20px 20px;
}

@media (max-width: 1050px) {
  .demo-dashboard-grid,
  .engagement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .landing-section {
    padding: 56px 20px;
  }

  .landing-nav {
    gap: 12px;
  }

  .nav-links {
    gap: 8px;
  }

  .nav-links a[href="#calculator-demo"],
  .nav-links a[href="#impact-dashboard"] {
    display: none;
  }

  .calculator-demo-grid,
  .demo-dashboard-grid,
  .engagement-grid,
  .goal-demo-panel,
  .insight-grid,
  .offset-goal-grid {
    grid-template-columns: 1fr;
  }

  .demo-calc-grid,
  .offset-body {
    grid-template-columns: 1fr;
  }

  .section-copy {
    margin-top: -28px;
  }

  .demo-total-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .recommendation-table > div {
    grid-template-columns: 1fr;
  }

  .landing-chart-box {
    height: 240px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   NEW ENHANCED SECTIONS — Added for full feature set
   ═══════════════════════════════════════════════════════════════ */

/* ── Trust badges in hero ──────────────────────────────────────── */
.hero-trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

.trust-badge .material-icons-round {
  font-size: 14px !important;
  color: #4ade80;
}

/* ── Stats Banner ───────────────────────────────────────────────── */
.stats-banner {
  background: linear-gradient(135deg, #1B4332 0%, #2D6A4F 100%);
  padding: 32px 40px;
}

.stats-banner-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.sb-value {
  font-size: 28px;
  font-weight: 900;
  color: #4ade80;
  line-height: 1;
  margin-bottom: 6px;
}

.sb-label {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}

/* ── Mobile Nav ─────────────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  padding: 6px 8px;
  line-height: 0;
  transition: background 0.2s;
}

.nav-hamburger:hover { background: rgba(255,255,255,0.1); }

.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 280px;
  background: linear-gradient(180deg, #1B4332 0%, #2D6A4F 100%);
  z-index: 1001;
  flex-direction: column;
  padding: 80px 24px 32px;
  gap: 4px;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.3);
}

.mobile-nav-drawer.open { transform: translateX(0); display: flex; }

.mobile-nav-drawer a {
  color: rgba(255,255,255,0.85);
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.mobile-nav-drawer a:hover { background: rgba(255,255,255,0.12); color: #4ade80; }

.mobile-get-started {
  background: rgba(74,222,128,0.15) !important;
  border: 1px solid rgba(74,222,128,0.35) !important;
  color: #4ade80 !important;
  margin-top: 8px;
  font-weight: 700 !important;
}

.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
}
.mobile-nav-overlay.open { display: block; }

.landing-nav.nav-scrolled {
  background: rgba(27,67,50,0.98);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

/* ── Calculator Sliders ─────────────────────────────────────────── */
.field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.field-header small {
  font-weight: 700;
  color: var(--accent-green);
  font-size: 12px;
}

.emission-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #2D6A4F, #4ade80);
  outline: none;
  cursor: pointer;
  margin: 8px 0 4px;
  -webkit-appearance: none;
  appearance: none;
}

.emission-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #4ade80;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(45,106,79,0.4);
  cursor: pointer;
  transition: transform 0.15s;
}

.emission-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

.slider-num {
  width: 70px;
  padding: 4px 8px;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
}

.emission-mini-chart-wrap {
  margin-top: 12px;
  padding: 12px 8px 4px;
  background: var(--bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

/* ── AI Prediction Box ─────────────────────────────────────────── */
.ai-badge {
  background: linear-gradient(135deg, #2D6A4F, #40916C);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.5px;
  margin-left: auto;
}

.ai-prediction-box {
  background: linear-gradient(135deg, rgba(45,106,79,0.1), rgba(64,145,108,0.08));
  border: 1px solid rgba(45,106,79,0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-pred-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.ai-pred-label .material-icons-round { font-size: 16px !important; color: var(--accent-green); }

.ai-pred-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin-left: auto;
}

/* ── Gamification Badges ────────────────────────────────────────── */
.gamification-section {
  margin: 40px 0 0;
}

.badge-levels-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.badge-level-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.badge-level-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.active-badge {
  border-color: var(--accent-green);
  background: linear-gradient(135deg, rgba(45,106,79,0.06), rgba(64,145,108,0.04));
  box-shadow: 0 0 0 2px rgba(45,106,79,0.2);
}

.badge-emoji { font-size: 40px; margin-bottom: 8px; }
.badge-level-name { font-size: 16px; font-weight: 800; color: var(--text-primary); margin-bottom: 6px; }
.badge-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.badge-points { font-size: 12px; font-weight: 700; color: var(--accent-green); background: rgba(45,106,79,0.1); padding: 3px 10px; border-radius: 20px; display: inline-block; }

/* ── Community Leaderboard ──────────────────────────────────────── */
.leaderboard-section { background: var(--bg-secondary); }

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

.leaderboard-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.lb-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(45,106,79,0.08), rgba(64,145,108,0.04));
  border-bottom: 1px solid var(--glass-border);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
}

.lb-header .material-icons-round { color: var(--accent-green); font-size: 18px !important; }

.lb-table { padding: 8px 0; }

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  font-size: 13px;
  transition: background 0.15s;
}

.lb-row:hover { background: var(--bg-primary); }

.lb-rank { font-size: 16px; width: 28px; text-align: center; }
.lb-name { flex: 1; font-weight: 600; color: var(--text-primary); }
.lb-val  { font-weight: 700; color: var(--accent-green); font-size: 12px; }

.lb-gold   { background: rgba(250,204,21,0.05); }
.lb-silver { background: rgba(148,163,184,0.05); }
.lb-bronze { background: rgba(180,83,9,0.05); }

/* Challenges in leaderboard */
.challenge-list { padding: 8px 0; }

.challenge-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  transition: background 0.15s;
}

.challenge-item:hover { background: var(--bg-primary); }

.challenge-icon { font-size: 22px; }
.challenge-item strong { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.challenge-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.challenge-pts { font-size: 12px; font-weight: 800; color: var(--accent-green); background: rgba(45,106,79,0.12); padding: 3px 8px; border-radius: 10px; white-space: nowrap; margin-left: auto; }

/* ── Offset Marketplace ─────────────────────────────────────────── */
.offset-section {
  background: linear-gradient(135deg, rgba(27,67,50,0.04), rgba(64,145,108,0.06));
}

.offset-ngo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.ngo-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ngo-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.ngo-icon {
  font-size: 32px;
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 28px;
}

.ngo-card h4 { font-size: 15px; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; }
.ngo-card p  { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; }

.ngo-badge {
  display: inline-block;
  background: rgba(45,106,79,0.12);
  color: var(--accent-green);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

.offset-calc-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 18px 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.offset-calc-bar .material-icons-round { color: var(--accent-green); font-size: 22px !important; }
.offset-calc-bar strong { color: var(--text-primary); }
.offset-calc-bar .btn { margin-left: auto; }

/* ── Educational Tips Carousel ──────────────────────────────────── */
.edu-section { }

.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.edu-tips-carousel {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 32px;
  min-height: 260px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.edu-tip {
  display: none;
  flex-direction: column;
  flex: 1;
  animation: tipFadeIn 0.4s ease;
}

.edu-tip.active { display: flex; }

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

.tip-icon { font-size: 36px; margin-bottom: 12px; }
.edu-tip h4 { font-size: 16px; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; }
.edu-tip p  { font-size: 14px; color: var(--text-secondary); line-height: 1.6; flex: 1; }

.edu-tip-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.tip-btn {
  background: var(--bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 0;
  transition: background 0.2s, color 0.2s;
}
.tip-btn:hover { background: var(--accent-green); color: #fff; border-color: var(--accent-green); }
.tip-btn .material-icons-round { font-size: 18px !important; }

.tip-dots { display: flex; gap: 6px; flex: 1; justify-content: center; }

.tip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--glass-border);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  padding: 0;
}
.tip-dot.active { background: var(--accent-green); transform: scale(1.3); }

/* Daily challenges panel */
.daily-challenges-panel {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.dc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(45,106,79,0.08), rgba(64,145,108,0.04));
  border-bottom: 1px solid var(--glass-border);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
}

.dc-header .material-icons-round { color: var(--accent-green); font-size: 18px !important; }

.dc-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: background 0.15s;
}

.dc-item:hover { background: var(--bg-primary); }
.dc-item:last-of-type { border-bottom: none; }

.dc-check { font-size: 18px; margin-top: 1px; }
.dc-item strong { font-size: 14px; color: var(--text-primary); }
.dc-pts { font-size: 12px; color: var(--accent-teal); margin-top: 2px; font-weight: 600; }
.daily-challenges-panel .btn { margin: 0 20px 20px; width: calc(100% - 40px); }

/* ── Enterprise Section ─────────────────────────────────────────── */
.enterprise-section {
  background: linear-gradient(180deg, rgba(27,67,50,0.06) 0%, rgba(64,145,108,0.03) 100%);
}

.enterprise-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.enterprise-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.enterprise-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.ent-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(45,106,79,0.12), rgba(64,145,108,0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.ent-icon .material-icons-round { color: var(--accent-green); font-size: 24px !important; }

.enterprise-card h4 { font-size: 15px; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; }
.enterprise-card p  { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

.enterprise-cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(135deg, #1B4332, #2D6A4F);
  border-radius: var(--radius);
  padding: 28px 32px;
  flex-wrap: wrap;
}

.enterprise-cta-bar h3 { color: #fff; font-size: 20px; margin-bottom: 4px; }
.enterprise-cta-bar p  { color: rgba(255,255,255,0.7); font-size: 14px; margin: 0; }

/* ── Security Section ───────────────────────────────────────────── */
.security-section {
  background: linear-gradient(180deg, rgba(15,23,42,0.03) 0%, rgba(27,67,50,0.04) 100%);
}

.security-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.security-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.security-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.sec-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.sec-icon .material-icons-round { font-size: 22px !important; }
.sec-green { background: rgba(74,222,128,0.12); } .sec-green .material-icons-round { color: #22c55e; }
.sec-blue  { background: rgba(96,165,250,0.12); } .sec-blue  .material-icons-round { color: #3b82f6; }
.sec-purple{ background: rgba(167,139,250,0.12);} .sec-purple .material-icons-round { color: #a855f7; }
.sec-orange{ background: rgba(251,146,60,0.12); } .sec-orange .material-icons-round { color: #f97316; }
.sec-teal  { background: rgba(45,212,191,0.12); } .sec-teal  .material-icons-round { color: #14b8a6; }
.sec-red   { background: rgba(239,68,68,0.12);  } .sec-red   .material-icons-round { color: #ef4444; }

.security-card h4 { font-size: 14px; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; }
.security-card p  { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 10px; }

.sec-status {
  font-size: 12px;
  font-weight: 700;
  color: #22c55e;
}

.security-threat-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.threat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  font-size: 14px;
}
.threat-label .material-icons-round { color: #22c55e; font-size: 20px !important; }

.threat-meter-wrap {
  flex: 1;
  height: 12px;
  background: var(--bg-primary);
  border-radius: 6px;
  overflow: hidden;
}

.threat-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  border-radius: 6px;
  width: 0;
  transition: width 1.5s cubic-bezier(0.4,0,0.2,1);
}

.threat-score {
  font-size: 14px;
  font-weight: 800;
  color: #22c55e;
  white-space: nowrap;
}

/* ── Footer Enhancements ─────────────────────────────────────────── */
.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: #4ade80; }

.footer-social {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-badge {
  font-size: 12px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
  padding: 4px 10px;
  border-radius: 20px;
}

.footer-copy {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin: 0;
}

/* ── AI Chatbot Widget ───────────────────────────────────────────── */
.chatbot-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
}

.chatbot-toggle {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1B4332, #2D6A4F);
  border: none;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(45,106,79,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.chatbot-toggle:hover { transform: scale(1.08); box-shadow: 0 12px 40px rgba(45,106,79,0.55); }

.chatbot-toggle .material-icons-round { font-size: 26px !important; }

.chatbot-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #4ade80;
  color: #1B4332;
  font-size: 9px;
  font-weight: 900;
  padding: 2px 5px;
  border-radius: 8px;
  letter-spacing: 0.3px;
}

.chatbot-panel {
  display: none;
  position: absolute;
  bottom: 72px; right: 0;
  width: 340px;
  max-height: 500px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  flex-direction: column;
  overflow: hidden;
  animation: chatSlideUp 0.3s cubic-bezier(0.4,0,0.2,1);
}

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

.chatbot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #1B4332, #2D6A4F);
  color: #fff;
}

.chatbot-header .material-icons-round { font-size: 24px !important; color: #4ade80; }
.chatbot-header strong { font-size: 14px; font-weight: 700; }
.chatbot-status { font-size: 11px; color: #4ade80; }

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 240px;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.bot-msg {
  background: var(--bg-primary);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.user-msg {
  background: linear-gradient(135deg, #1B4332, #2D6A4F);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.chat-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 16px;
}

.chat-typing span {
  width: 6px; height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: typingBounce 0.9s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.2); opacity: 1; }
}

.chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  border-top: 1px solid var(--glass-border);
}

.chat-suggest-btn {
  background: var(--bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.chat-suggest-btn:hover { background: var(--accent-green); color: #fff; border-color: var(--accent-green); }

.chatbot-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--glass-border);
}

.chatbot-input-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.chatbot-input-row input:focus { border-color: var(--accent-green); }

.chatbot-send-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1B4332, #2D6A4F);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.chatbot-send-btn:hover { transform: scale(1.1); }
.chatbot-send-btn .material-icons-round { font-size: 17px !important; }

/* ── Responsive Improvements ─────────────────────────────────────── */
@media (max-width: 1050px) {
  .enterprise-grid,
  .security-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .offset-ngo-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .leaderboard-grid {
    grid-template-columns: 1fr;
  }

  .badge-levels-row {
    grid-template-columns: 1fr;
  }

  .stats-banner-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 780px) {
  /* Mobile nav visibility */
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  /* Stats banner */
  .stats-banner { padding: 24px 20px; }
  .stats-banner-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .sb-value { font-size: 22px; }

  /* Enterprise grid */
  .enterprise-grid,
  .security-grid {
    grid-template-columns: 1fr;
  }

  /* NGO grid */
  .offset-ngo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  /* Enterprise CTA bar */
  .enterprise-cta-bar { flex-direction: column; text-align: center; }

  /* Edu grid */
  .edu-grid { grid-template-columns: 1fr; }

  /* Offset bar */
  .offset-calc-bar { flex-direction: column; text-align: center; }
  .offset-calc-bar .btn { margin-left: 0; }

  /* Security threat bar */
  .security-threat-bar { flex-direction: column; gap: 12px; }
  .threat-meter-wrap { width: 100%; }

  /* Chatbot */
  .chatbot-widget { bottom: 16px; right: 16px; }
  .chatbot-panel { width: calc(100vw - 32px); max-width: 340px; right: 0; }

  /* Footer */
  .footer-content { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
  .footer-social { justify-content: center; }

  /* Hero trust badges */
  .hero-trust-badges { gap: 6px; }
  .trust-badge { font-size: 11px; padding: 4px 8px; }

  /* Leaderboard */
  .leaderboard-grid { grid-template-columns: 1fr; }

  /* Badge levels */
  .badge-levels-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .offset-ngo-grid { grid-template-columns: 1fr; }
  .stats-banner-grid { grid-template-columns: 1fr; }
  .chatbot-toggle { width: 52px; height: 52px; }
}

/* ── Dashboard AI Insight Extras ────────────────────────────────── */
.ai-insight-detail {
  margin: 10px 0;
}

.ai-insight-detail p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.ai-action-chip {
  display: inline-block;
  background: linear-gradient(135deg, rgba(45,106,79,0.1), rgba(64,145,108,0.08));
  border: 1px solid rgba(45,106,79,0.2);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-green);
  margin-top: 2px;
}

.ai-monthly-pred {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(45,106,79,0.06);
  border: 1px solid rgba(45,106,79,0.15);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
}

.ai-monthly-pred .material-icons-round {
  font-size: 16px !important;
  color: var(--accent-green);
}

.ai-monthly-pred strong {
  color: var(--text-primary);
}
