/* ═══════════════════════════════════════════════════════════════════════════════
   ANHAD DASHBOARD — Ultimate Claymorphism Edition
   Molded 3D cards with multi-layer shadows and tactile feedback
   ═══════════════════════════════════════════════════════════════════════════════ */

@import url('../css/claymorphism-system.css');

:root {
  /* Claymorphism Dashboard Tokens */
  --dash-bg-primary: #E8EAEF;
  
  --dash-card-shadow: 
    16px 16px 32px rgba(0,0,0,0.06), 
    -16px -16px 32px rgba(255,255,255,0.9), 
    inset 8px 8px 16px rgba(255,255,255,0.8), 
    inset -8px -8px 16px rgba(0,0,0,0.04);
  --dash-card-shadow-active:
    inset 16px 16px 32px rgba(0,0,0,0.08), 
    inset -16px -16px 32px rgba(255,255,255,0.9);
  --dash-btn-shadow:
    8px 8px 16px rgba(0,0,0,0.06), 
    -8px -8px 16px rgba(255,255,255,0.9), 
    inset 4px 4px 8px rgba(255,255,255,0.9), 
    inset -4px -4px 8px rgba(0,0,0,0.04);
  --dash-inset-shadow:
    inset 4px 4px 8px rgba(0,0,0,0.08), 
    inset -4px -4px 8px rgba(255,255,255,0.9);

  --dash-gold: 212, 148, 58;
  --dash-orange: 255, 149, 0;
  --dash-blue: 0, 122, 255;
  --dash-green: 48, 209, 88;
  --dash-purple: 88, 86, 214;
  --dash-red: 255, 45, 85;
  
  /* Typography */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  --dash-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dash-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Radius Scale */
  --radius-sm: 16px;
  --radius-md: 24px;
  --radius-lg: 28px;
  --radius-xl: 32px;
  --radius-full: 9999px;
  
  /* Safe Areas */
  --safe-top: env(safe-area-inset-top, 44px);
  --safe-bottom: env(safe-area-inset-bottom, 34px);
}

/* Dark Mode Tokens */
html.dark-mode {
  --dash-bg-primary: #1C1C1F;
  --dash-card-shadow: 
    16px 16px 32px rgba(0,0,0,0.6), 
    -16px -16px 32px rgba(255,255,255,0.03), 
    inset 8px 8px 16px rgba(255,255,255,0.03), 
    inset -8px -8px 16px rgba(0,0,0,0.4);
  --dash-card-shadow-active:
    inset 16px 16px 32px rgba(0,0,0,0.6), 
    inset -16px -16px 32px rgba(255,255,255,0.04);
  --dash-btn-shadow:
    8px 8px 16px rgba(0,0,0,0.6), 
    -8px -8px 16px rgba(255,255,255,0.03), 
    inset 4px 4px 8px rgba(255,255,255,0.03), 
    inset -4px -4px 8px rgba(0,0,0,0.4);
  --dash-inset-shadow:
    inset 4px 4px 8px rgba(0,0,0,0.8), 
    inset -4px -4px 8px rgba(255,255,255,0.03);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-display);
  background: var(--dash-bg-primary);
  color: var(--text-primary, #000000);
  min-height: 100vh;
  padding-bottom: calc(120px + var(--safe-bottom));
  -webkit-font-smoothing: antialiased;
}

html.dark-mode body {
  color: #FFFFFF;
}

.app {
  max-width: 500px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   HEADER — Clay Style Floating Bar
   ═══════════════════════════════════════════════════════════════════════════════ */
.top-nav-orb {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--safe-top) + 64px);
  background: linear-gradient(180deg, rgba(255,255,255,0.85) 0%, rgba(245,245,247,0.75) 100%);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  z-index: 100;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

html.dark-mode .top-nav-orb {
  background: linear-gradient(180deg, rgba(28,28,30,0.85) 0%, rgba(20,20,22,0.75) 100%);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.header {
  position: fixed;
  top: var(--safe-top);
  left: 0;
  right: 0;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  z-index: 101;
}

.spacer {
  height: calc(var(--safe-top) + 80px);
}

/* Clay Header Buttons */
.header__back, .header__btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--dash-bg-primary);
  box-shadow: var(--dash-btn-shadow);
  color: var(--text-primary, #000000);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s var(--dash-spring);
  font-size: 16px;
}

html.dark-mode .header__back,
html.dark-mode .header__btn {
  background: var(--dash-bg-primary);
  box-shadow: var(--dash-btn-shadow);
  color: #FFFFFF;
}

.header__back:active, .header__btn:active {
  transform: scale(0.92);
  box-shadow: var(--dash-card-shadow-active);
}

.header__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, var(--text-primary, #000) 20%, rgba(0,0,0,0.6) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.dark-mode .header__title {
  background: linear-gradient(180deg, #FFFFFF 20%, rgba(255,255,255,0.7) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   STREAK HERO — Clean White Clay Card
   ═══════════════════════════════════════════════════════════════════════════════ */
.streak-hero {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 40px 24px;
  margin-bottom: 32px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--text-primary, #000);
  background: var(--dash-bg-primary);
  box-shadow: var(--dash-card-shadow);
  border: none;
  transform: perspective(1000px) translateZ(0);
  transition: all 0.4s var(--dash-spring);
}

html.dark-mode .streak-hero {
  background: var(--dash-bg-primary);
  box-shadow: var(--dash-card-shadow);
  border: none;
}

.streak-hero:active {
  transform: perspective(1000px) scale(0.96) translateZ(0);
  box-shadow: var(--dash-card-shadow-active);
}

/* Remove animated orb to keep pure clay block */
.streak-hero::before {
  display: none;
}

/* Freeze Badge — Clay Pill */
.streak-hero__freeze {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--dash-bg-primary);
  box-shadow: var(--dash-btn-shadow);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 800;
  color: rgba(var(--dash-gold), 1);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}

html.dark-mode .streak-hero__freeze {
  background: var(--dash-bg-primary);
  box-shadow: var(--dash-btn-shadow);
  border: none;
  color: rgba(var(--dash-gold), 0.9);
}

.streak-hero__label {
  font-size: 14px;
  font-weight: 800;
  color: rgba(var(--dash-gold), 0.9);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-shadow: 0 2px 4px rgba(255, 255, 255, 0.5);
  z-index: 2;
  position: relative;
}

.streak-hero__count {
  font-size: 100px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.9;
  margin-bottom: 8px;
  color: rgba(var(--dash-gold), 1);
  text-shadow: 
    0 4px 20px rgba(var(--dash-gold), 0.4),
    0 8px 40px rgba(var(--dash-gold), 0.2);
  z-index: 2;
  position: relative;
  font-feature-settings: "tnum";
}

.streak-hero__subtitle {
  font-size: 17px;
  font-weight: 600;
  color: rgba(var(--dash-gold), 0.75);
  letter-spacing: -0.01em;
  z-index: 2;
  position: relative;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SECTION TITLE — Clay Header
   ═══════════════════════════════════════════════════════════════════════════════ */
.section-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  color: var(--text-primary, #000);
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  padding: 4px 8px;
  width: fit-content;
  border: none;
}

html.dark-mode .section-title {
  color: #FFFFFF;
  background: transparent;
  border: none;
}

.section-title i {
  font-size: 20px;
  background: linear-gradient(135deg, var(--dash-gold), var(--dash-orange));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   STATS GRID — Clay Colored Cards
   ═══════════════════════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

.stat-card {
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--dash-spring);
  display: flex;
  flex-direction: column;
  transform: translateZ(0);
  background: var(--dash-bg-primary);
  box-shadow: var(--dash-card-shadow);
  border: none;
}

.stat-card:active {
  transform: scale(0.96) translateY(4px);
  box-shadow: var(--dash-card-shadow-active);
}

html.dark-mode .stat-card {
  background: var(--dash-bg-primary);
  box-shadow: var(--dash-card-shadow);
  border: none;
}

/* Stat Card Icon — Clay Circle */
.stat-card__icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 20px;
  color: white;
  box-shadow:
    8px 8px 20px rgba(0, 0, 0, 0.2),
    -4px -4px 12px rgba(255, 255, 255, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.stat-card--orange .stat-card__icon-wrap { background: linear-gradient(135deg, #FF9500 0%, #E68A00 100%); }
.stat-card--blue .stat-card__icon-wrap { background: linear-gradient(135deg, #5AC8FA 0%, #007AFF 100%); }
.stat-card--green .stat-card__icon-wrap { background: linear-gradient(135deg, #34C759 0%, #28A745 100%); }
.stat-card--purple .stat-card__icon-wrap { background: linear-gradient(135deg, #D578FF 0%, #AF52DE 100%); }

.stat-card__value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary, #000);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -0.03em;
  font-feature-settings: "tnum";
}

html.dark-mode .stat-card__value {
  color: #FFFFFF;
}

.stat-card__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, rgba(0,0,0,0.6));
  letter-spacing: -0.01em;
}

html.dark-mode .stat-card__label {
  color: rgba(255, 255, 255, 0.6);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   GOALS LIST — Clay Goal Cards
   ═══════════════════════════════════════════════════════════════════════════════ */
.goals-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

.goal-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--dash-bg-primary);
  box-shadow: var(--dash-card-shadow);
  border: none;
  transition: all 0.4s var(--dash-spring);
  transform: translateZ(0);
}

html.dark-mode .goal-card {
  background: var(--dash-bg-primary);
  border: none;
  box-shadow: var(--dash-card-shadow);
}

.goal-card:active {
  transform: scale(0.98) translateY(3px);
  box-shadow: var(--dash-card-shadow-active);
}

.goal-card--complete {
  border-color: rgba(var(--dash-green), 0.5);
  background: linear-gradient(145deg, #F0FFF5 0%, #E8F8F0 100%);
  box-shadow:
    30px 30px 80px rgba(var(--dash-green), 0.35),
    15px 15px 40px rgba(var(--dash-green), 0.2),
    -15px -15px 40px rgba(255, 255, 255, 0.9),
    0 0 0 3px rgba(var(--dash-green), 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 1),
    inset 0 -1px 2px rgba(0, 0, 0, 0.04);
}

html.dark-mode .goal-card--complete {
  background: linear-gradient(145deg, #183020 0%, #102818 100%);
  border-color: rgba(var(--dash-green), 0.3);
  box-shadow:
    30px 30px 80px rgba(var(--dash-green), 0.25),
    15px 15px 40px rgba(var(--dash-green), 0.15),
    -15px -15px 40px rgba(255, 255, 255, 0.05),
    0 0 0 3px rgba(var(--dash-green), 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 0.1),
    inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.goal-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  color: white;
  box-shadow:
    6px 6px 16px rgba(0, 0, 0, 0.2),
    -3px -3px 10px rgba(255, 255, 255, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.bg-gold { background: linear-gradient(135deg, #FFCC00, #FF9500); }
.bg-blue { background: linear-gradient(135deg, #5AC8FA, #007AFF); }
.bg-green { background: linear-gradient(135deg, #34C759, #28A745); }
.bg-purple { background: linear-gradient(135deg, #D578FF, #AF52DE); }

.goal-card__content {
  flex: 1;
}

.goal-card__header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.goal-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, #000);
  letter-spacing: -0.01em;
}

html.dark-mode .goal-card__title {
  color: #FFFFFF;
}

.goal-card__status {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary, rgba(0,0,0,0.5));
  font-feature-settings: "tnum";
}

html.dark-mode .goal-card__status {
  color: rgba(255, 255, 255, 0.5);
}

/* Clay Progress Track */
.goal-card__progress-wrap {
  width: 100%;
  height: 12px;
  background: linear-gradient(145deg, rgba(0,0,0,0.03), rgba(0,0,0,0.06));
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow:
    inset 2px 2px 6px rgba(0, 0, 0, 0.08),
    inset -1px -1px 3px rgba(255, 255, 255, 0.8),
    0 1px 2px rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

html.dark-mode .goal-card__progress-wrap {
  background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0.08));
  box-shadow:
    inset 2px 2px 6px rgba(0, 0, 0, 0.3),
    inset -1px -1px 3px rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.1);
}

.goal-card__fill {
  height: 100%;
  border-radius: var(--radius-full);
  box-shadow: 
    inset 0 1px 3px rgba(0,0,0,0.2),
    0 1px 2px rgba(255,255,255,0.3);
  transition: width 1s var(--dash-spring);
  position: relative;
  overflow: hidden;
}

.goal-card__fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: shine 2.5s infinite;
}

@keyframes shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* Clay Checkmark */
.goal-card__check {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #34C759, #28A745);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow:
    4px 4px 12px rgba(52, 199, 89, 0.4),
    -2px -2px 8px rgba(255, 255, 255, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: popScale 0.5s var(--dash-spring) forwards;
}

@keyframes popScale {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ANALYTICS CHART — Claymorphism 7-Day Progress
   ═══════════════════════════════════════════════════════════════════════════════ */
.analytics-chart {
  border-radius: var(--radius-xl);
  padding: 24px;
  background: var(--dash-bg-primary);
  box-shadow: var(--dash-card-shadow);
  border: none;
  margin-bottom: 32px;
}

html.dark-mode .analytics-chart {
  background: var(--dash-bg-primary);
  box-shadow: var(--dash-card-shadow);
}

.chart-header {
  margin-bottom: 20px;
}

.chart-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary, #000);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

html.dark-mode .chart-title {
  color: #FFFFFF;
}

.chart-title i {
  font-size: 16px;
  color: rgba(var(--dash-gold), 1);
}

.chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, rgba(0,0,0,0.6));
}

html.dark-mode .legend-item {
  color: rgba(255, 255, 255, 0.6);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.legend-dot--blue { background: linear-gradient(135deg, #5AC8FA, #007AFF); }
.legend-dot--yellow { background: linear-gradient(135deg, #FFCC00, #FF9500); }
.legend-dot--green { background: linear-gradient(135deg, #34C759, #28A745); }

.chart-body {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  height: 200px;
  padding: 20px 0;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(0,0,0,0.02), rgba(0,0,0,0.04));
  box-shadow: var(--dash-inset-shadow);
  margin-bottom: 16px;
}

html.dark-mode .chart-body {
  background: linear-gradient(145deg, rgba(255,255,255,0.03), rgba(255,255,255,0.05));
}

.chart-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 160px;
  width: 100%;
}

.chart-bar {
  flex: 1;
  min-height: 8px;
  max-height: 144px; /* 90% of 160px container to prevent overflow */
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  box-shadow: 
    inset 0 2px 4px rgba(255, 255, 255, 0.5),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1),
    0 4px 8px rgba(0, 0, 0, 0.15);
  transform: scaleY(0);
  transform-origin: bottom;
}

.chart-bar.animated {
  transform: scaleY(1);
}

.chart-bar:hover {
  transform: scaleY(1.05);
  filter: brightness(1.1);
}

.chart-bar--blue {
  background: linear-gradient(180deg, #5AC8FA 0%, #007AFF 100%);
}

.chart-bar--yellow {
  background: linear-gradient(180deg, #FFCC00 0%, #FF9500 100%);
}

.chart-bar--green {
  background: linear-gradient(180deg, #34C759 0%, #28A745 100%);
}

.bar-value {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-primary, #000);
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
}

html.dark-mode .bar-value {
  color: #FFFFFF;
}

.chart-bar:hover .bar-value {
  opacity: 1;
}

.chart-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary, rgba(0,0,0,0.5));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

html.dark-mode .chart-label {
  color: rgba(255, 255, 255, 0.5);
}

.chart-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

html.dark-mode .chart-footer {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.chart-insight {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(145deg, rgba(255, 204, 0, 0.1), rgba(255, 149, 0, 0.1));
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #000);
  line-height: 1.5;
  box-shadow: var(--dash-inset-shadow);
}

html.dark-mode .chart-insight {
  background: linear-gradient(145deg, rgba(255, 204, 0, 0.15), rgba(255, 149, 0, 0.15));
  color: #FFFFFF;
}

.chart-insight i {
  font-size: 16px;
  color: rgba(var(--dash-gold), 1);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MILESTONES — Clay Badges
   ═══════════════════════════════════════════════════════════════════════════════ */
.milestones {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 20px 24px 2px;
  margin-bottom: 24px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.milestones::-webkit-scrollbar { display: none; }

.milestone {
  flex-shrink: 0;
  width: 96px;
  height: 116px;
  padding: 18px 10px;
  background: linear-gradient(145deg, #FFFFFF 0%, #F5F5F7 100%);
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 1),
    inset 0 -2px 4px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.06);
  opacity: 0.5;
  filter: grayscale(1) opacity(0.7);
  transition: all 0.4s var(--dash-spring);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

html.dark-mode .milestone {
  background: linear-gradient(145deg, #2C2C2E 0%, #1C1C1E 100%);
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.03),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.milestone--achieved {
  opacity: 1;
  filter: grayscale(0);
  background: linear-gradient(145deg, #FFFFFF 0%, #F8F8FA 50%, #F5F5F7 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 1),
    inset 0 -2px 6px rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 122, 255, 0.15);
  transform: translateY(-4px);
}

html.dark-mode .milestone--achieved {
  background: linear-gradient(145deg, #2C2C2E 0%, #1C1C1E 50%, #1A1A1C 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.04),
    inset 0 -2px 6px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.08);
}

.milestone__emoji {
  font-size: 36px;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.milestone__days {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary, #000);
  line-height: 1;
  letter-spacing: -0.02em;
}

html.dark-mode .milestone__days {
  color: #FFFFFF;
}

.milestone__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary, rgba(0,0,0,0.5));
  text-transform: uppercase;
  margin-top: 3px;
  letter-spacing: 0.05em;
}

html.dark-mode .milestone__label {
  color: rgba(255, 255, 255, 0.5);
}

.milestone--achieved .milestone__days {
  color: rgba(var(--dash-gold), 1);
}

.milestone--achieved .milestone__label {
  color: rgba(var(--dash-gold), 0.8);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BOTTOM NAVIGATION — Clay Floating Pill
   ═══════════════════════════════════════════════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  justify-content: center;
  padding: 0 24px;
  padding-bottom: calc(12px + var(--safe-bottom));
  pointer-events: none;
}

.bottom-nav__glass {
  pointer-events: all;
  width: 100%;
  max-width: 320px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 8px;
  height: 64px;
  background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(245,245,247,0.95));
  border-radius: var(--radius-xl);
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.35),
    0 10px 35px rgba(0, 0, 0, 0.2),
    0 0 0 3px rgba(255, 255, 255, 0.6),
    inset 0 3px 6px rgba(255, 255, 255, 1),
    inset 0 -1px 2px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

html.dark-mode .bottom-nav__glass {
  background: linear-gradient(145deg, rgba(40,40,42,0.95), rgba(28,28,30,0.95));
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.5),
    0 10px 35px rgba(0, 0, 0, 0.35),
    0 0 0 3px rgba(255, 255, 255, 0.15),
    inset 0 3px 6px rgba(255, 255, 255, 0.1),
    inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 20px;
  border: none;
  background: transparent;
  text-decoration: none;
  color: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: all 0.3s var(--dash-spring);
  -webkit-tap-highlight-color: transparent;
  min-width: 56px;
  position: relative;
  z-index: 1;
}

html.dark-mode .nav-tab {
  color: rgba(255, 255, 255, 0.4);
}

.nav-tab:active {
  transform: scale(0.88);
}

.ios-emoji--nav {
  font-size: 22px;
  line-height: 1;
  transition: all 0.3s var(--dash-spring);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.nav-tab__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}

.nav-tab--active {
  color: #000000 !important;
}

html.dark-mode .nav-tab--active {
  color: #FFFFFF !important;
}

.nav-tab--active .nav-tab__label {
  font-weight: 700;
  color: #000000;
  transform: translateY(-1px);
}

html.dark-mode .nav-tab--active .nav-tab__label {
  color: #FFFFFF;
  font-weight: 800;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

.nav-tab--active .ios-emoji--nav {
  opacity: 1 !important;
  transform: scale(1.25) translateY(-2px);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

html.dark-mode .nav-tab--active .ios-emoji--nav {
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.6)) drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════════ */
@keyframes premiumPopIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(30px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

.app > *:not(.top-nav-orb):not(.header) {
  animation: premiumPopIn 0.7s var(--dash-spring) backwards;
}

.app > *:nth-child(2) { animation-delay: 0.05s; }
.app > *:nth-child(3) { animation-delay: 0.1s; }
.app > *:nth-child(4) { animation-delay: 0.15s; }
.app > *:nth-child(5) { animation-delay: 0.2s; }
.app > *:nth-child(6) { animation-delay: 0.25s; }
.app > *:nth-child(7) { animation-delay: 0.3s; }

/* Stagger for grid items */
.stats-grid .stat-card:nth-child(1) { animation-delay: 0.1s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.15s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.2s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.25s; }

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 380px) {
  .stats-grid {
    gap: 12px;
  }
  
  .stat-card {
    padding: 18px;
  }
  
  .stat-card__value {
    font-size: 26px;
  }
  
  .streak-hero__count {
    font-size: 72px;
  }
  
  .milestone {
    width: 84px;
    height: 104px;
    padding: 14px 8px;
  }
  
  .milestone__emoji {
    font-size: 28px;
  }
}

@media (min-width: 500px) {
  .app {
    padding: 0 24px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   NITNEM PROGRESS CHART — Claymorphism Bar Graph
   ═══════════════════════════════════════════════════════════════════════════════ */
.nitnem-progress-chart {
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--dash-bg-primary);
  box-shadow: var(--dash-card-shadow);
  border: none;
  margin-bottom: 40px;
  transition: all 0.4s var(--dash-spring);
}

html.dark-mode .nitnem-progress-chart {
  background: var(--dash-bg-primary);
  box-shadow: var(--dash-card-shadow);
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  height: 180px;
  margin-bottom: 16px;
  padding: 0 4px;
}

.chart-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.chart-bar__column {
  width: 100%;
  background: linear-gradient(145deg, rgba(0,0,0,0.03), rgba(0,0,0,0.06));
  border-radius: 12px 12px 8px 8px;
  position: relative;
  transition: all 0.6s var(--dash-spring);
  box-shadow:
    inset 3px 3px 8px rgba(0, 0, 0, 0.08),
    inset -2px -2px 6px rgba(255, 255, 255, 0.8),
    0 2px 4px rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
  overflow: hidden;
  min-height: 24px;
}

html.dark-mode .chart-bar__column {
  background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0.08));
  box-shadow:
    inset 3px 3px 8px rgba(0, 0, 0, 0.3),
    inset -2px -2px 6px rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.1);
}

.chart-bar__fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, 
    rgba(var(--dash-green), 0.9) 0%, 
    rgba(var(--dash-green), 1) 100%);
  border-radius: 12px 12px 8px 8px;
  transition: height 1s var(--dash-spring);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.3),
    inset 0 -1px 2px rgba(0, 0, 0, 0.2),
    0 -2px 8px rgba(var(--dash-green), 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.chart-bar__fill::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.3), transparent);
  border-radius: 12px 12px 0 0;
}

.chart-bar__value {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary, #000);
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

html.dark-mode .chart-bar__value {
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.chart-bar__column:hover .chart-bar__value {
  opacity: 1;
}

.chart-bar__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary, rgba(0,0,0,0.6));
  text-align: center;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

html.dark-mode .chart-bar__label {
  color: rgba(255, 255, 255, 0.6);
}

.chart-bar--today .chart-bar__label {
  color: rgba(var(--dash-gold), 1);
  font-weight: 800;
}

.chart-bar--complete .chart-bar__fill {
  background: linear-gradient(180deg, 
    rgba(var(--dash-green), 0.85) 0%, 
    rgba(var(--dash-green), 1) 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.4),
    inset 0 -1px 2px rgba(0, 0, 0, 0.2),
    0 -2px 12px rgba(var(--dash-green), 0.5),
    0 0 20px rgba(var(--dash-green), 0.3);
}

.chart-bar--incomplete .chart-bar__fill {
  background: linear-gradient(180deg, 
    rgba(var(--dash-orange), 0.7) 0%, 
    rgba(var(--dash-orange), 0.85) 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.3),
    inset 0 -1px 2px rgba(0, 0, 0, 0.2),
    0 -2px 8px rgba(var(--dash-orange), 0.3);
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

html.dark-mode .chart-legend {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.chart-legend__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, rgba(0,0,0,0.6));
}

html.dark-mode .chart-legend__item {
  color: rgba(255, 255, 255, 0.6);
}

.chart-legend__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow:
    2px 2px 4px rgba(0, 0, 0, 0.15),
    -1px -1px 2px rgba(255, 255, 255, 0.5),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.chart-legend__dot--complete {
  background: linear-gradient(135deg, 
    rgba(var(--dash-green), 1), 
    rgba(var(--dash-green), 0.8));
}

.chart-legend__dot--incomplete {
  background: linear-gradient(135deg, 
    rgba(var(--dash-orange), 1), 
    rgba(var(--dash-orange), 0.8));
}

/* Empty state */
.chart-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary, rgba(0,0,0,0.5));
}

html.dark-mode .chart-empty {
  color: rgba(255, 255, 255, 0.5);
}

.chart-empty__icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.chart-empty__text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

/* Animation */
@keyframes barGrow {
  from {
    height: 0;
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.chart-bar__fill {
  animation: barGrow 0.8s var(--dash-spring) backwards;
}

.chart-bar:nth-child(1) .chart-bar__fill { animation-delay: 0.1s; }
.chart-bar:nth-child(2) .chart-bar__fill { animation-delay: 0.2s; }
.chart-bar:nth-child(3) .chart-bar__fill { animation-delay: 0.3s; }
.chart-bar:nth-child(4) .chart-bar__fill { animation-delay: 0.4s; }
.chart-bar:nth-child(5) .chart-bar__fill { animation-delay: 0.5s; }
.chart-bar:nth-child(6) .chart-bar__fill { animation-delay: 0.6s; }
