/* Goal Tracker - Modern Professional Design */

:root {
  /* Brand Colors */
  --primary-base: 206, 80%, 6%;
  --primary: hsl(var(--primary-base));
  --primary-dark: hsl(206, 80%, 4%);
  --primary-light: hsl(206, 80%, 15%);

  --secondary-base: 202, 100%, 46%;
  --secondary: hsl(var(--secondary-base));
  --secondary-hover: hsl(202, 100%, 40%);
  --secondary-dark: hsl(202, 100%, 36%);

  --accent-base: 38, 92%, 50%;
  --accent: hsl(var(--accent-base));

  /* Semantic Feedback */
  --success: hsl(150, 84%, 37%);
  --success-bg: hsl(150, 84%, 96%);
  --danger: hsl(350, 89%, 60%);
  --danger-bg: hsl(350, 89%, 97%);
  --warning: hsl(45, 93%, 47%);
  --warning-bg: hsl(45, 93%, 96%);

  /* Neutrals (Tailored Slate Grid) */
  --neutral-50: hsl(210, 40%, 98%);
  --neutral-100: hsl(210, 30%, 95%);
  --neutral-200: hsl(210, 20%, 90%);
  --neutral-300: hsl(210, 16%, 82%);
  --neutral-500: hsl(210, 10%, 57%);
  --neutral-700: hsl(210, 11%, 30%);
  --neutral-900: hsl(210, 15%, 12%);
  --white: #ffffff;

  /* Legacy gray aliases */
  --gray-50: var(--neutral-50);
  --gray-100: var(--neutral-100);
  --gray-200: var(--neutral-200);
  --gray-300: var(--neutral-300);
  --gray-400: hsl(210, 12%, 68%);
  --gray-500: var(--neutral-500);
  --gray-600: hsl(210, 10%, 45%);
  --gray-700: var(--neutral-700);
  --gray-800: hsl(210, 13%, 20%);
  --gray-900: var(--neutral-900);

  /* Surfaces & Glassmorphism */
  --surface-page: #f8fafc;
  --surface-raised: #ffffff;
  --surface-sunken: var(--neutral-100);
  --border-default: #e8ecef;
  --text-on-accent: #ffffff;
  --accent-subtle: #e6f4fd;
  --surface-card: var(--surface-raised);
  --surface-overlay: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
  --backdrop-blur: 12px;

  /* Goal Tracker UI kit aliases (--gt-*) */
  --gt-color-primary: #2563eb;
  --gt-color-primary-light: #eff6ff;
  --gt-color-primary-border: #bfdbfe;
  --gt-color-error: #f04438;
  --gt-bg-surface: var(--surface-raised);
  --gt-border-light: var(--neutral-200);
  --gt-fill-secondary: var(--neutral-100);
  --gt-text-primary: var(--neutral-900);
  --gt-text-secondary: var(--neutral-500);
  --gt-text-tertiary: var(--gray-400);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);

  /* Borders & Radius */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* Spacing */
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;

  /* Animations */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease-out;

  /* Typography */
  --font-display: 'Outfit', 'DM Sans', sans-serif;
  --font-ui: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Text (adapt in [data-theme="dark"]) */
  --text-heading: var(--primary);
  --text-body: var(--neutral-900);
  --text-subtle: var(--neutral-500);
  --text-label: var(--neutral-700);
}

[data-theme="dark"] {
  --primary-light: hsl(206, 80%, 22%);
  --success-bg: hsl(150, 40%, 14%);
  --danger-bg: hsl(350, 40%, 14%);
  --warning-bg: hsl(45, 40%, 14%);

  --neutral-50: hsl(210, 15%, 10%);
  --neutral-100: hsl(210, 14%, 14%);
  --neutral-200: hsl(210, 12%, 22%);
  --neutral-300: hsl(210, 10%, 32%);
  --neutral-500: hsl(210, 8%, 62%);
  --neutral-700: hsl(210, 12%, 82%);
  --neutral-900: hsl(210, 40%, 96%);
  --white: hsl(210, 14%, 16%);

  --gray-50: var(--neutral-50);
  --gray-100: var(--neutral-100);
  --gray-200: var(--neutral-200);
  --gray-300: var(--neutral-300);
  --gray-400: hsl(210, 8%, 52%);
  --gray-500: var(--neutral-500);
  --gray-600: hsl(210, 8%, 72%);
  --gray-700: var(--neutral-700);
  --gray-800: hsl(210, 12%, 88%);
  --gray-900: var(--neutral-900);

  --surface-page: hsl(210, 15%, 10%);
  --surface-raised: hsl(210, 14%, 16%);
  --surface-sunken: hsl(210, 14%, 20%);
  --border-default: hsl(210, 12%, 24%);
  --text-on-accent: #ffffff;
  --accent-subtle: hsl(202, 60%, 18%);
  --surface-card: hsl(210, 14%, 18%);
  --surface-overlay: rgba(15, 23, 42, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);

  --gt-color-primary: #60a5fa;
  --gt-color-primary-light: hsl(214, 45%, 18%);
  --gt-color-primary-border: hsl(214, 40%, 28%);
  --gt-color-error: #f87171;
  --gt-bg-surface: var(--surface-raised);
  --gt-border-light: var(--border-default);
  --gt-fill-secondary: var(--surface-sunken);
  --gt-text-primary: var(--neutral-900);
  --gt-text-secondary: var(--neutral-500);
  --gt-text-tertiary: var(--gray-400);

  --text-heading: var(--neutral-900);
  --text-body: var(--neutral-900);
  --text-subtle: var(--neutral-500);
  --text-label: var(--neutral-700);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.35);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.45), 0 2px 4px -1px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.35);

  color-scheme: dark;
}

[data-theme="dark"] body,
[data-theme="dark"] .user-body {
  background: var(--surface-page);
  color: var(--neutral-900);
}

[data-theme="dark"] .settings-card,
[data-theme="dark"] .user-main,
[data-theme="dark"] .user-content,
[data-theme="dark"] .gt-page {
  background: var(--surface-page);
  color: var(--neutral-900);
}

.theme-toggle-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.theme-toggle-option {
  border: 1px solid var(--neutral-200);
  background: var(--surface-card);
  color: var(--neutral-700);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.theme-toggle-option.is-active {
  border-color: var(--secondary);
  background: hsl(202, 100%, 96%);
  color: var(--secondary-dark);
  font-weight: 600;
}

[data-theme="dark"] .theme-toggle-option.is-active {
  background: hsl(202, 60%, 18%);
  color: var(--neutral-900);
}

/* --- Goal Tracker UI kit (gt-*) --- */
.gt-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md) var(--space-xl);
}

.gt-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.gt-page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--neutral-900);
  line-height: 1.2;
  margin: 0;
}

.gt-page-subtitle {
  font-size: 0.9375rem;
  color: var(--neutral-500);
  margin: 0.25rem 0 0;
}

.gt-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.gt-card {
  background: var(--surface-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-default);
  margin-bottom: var(--space-md);
  overflow: hidden;
}

.gt-card-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-default);
}

.gt-card-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-heading);
}

.gt-card-body {
  padding: var(--space-lg);
}

.weekly-summary-hero-value {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.weekly-summary-metric-value {
  font-size: 1.5rem;
  color: var(--secondary);
  margin: 0 0 0.5rem;
}

.weekly-summary-metric-label {
  color: var(--text-label);
  margin: 0;
}

.weekly-summary-metric-hint {
  color: var(--text-subtle);
  font-size: 0.875rem;
  margin: 0.25rem 0 0;
}

.weekly-summary-goal-row {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-default);
}

.weekly-summary-goal-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.weekly-summary-goal-meta {
  color: var(--text-subtle);
  font-size: 0.875rem;
  margin-left: 0.5rem;
}

.weekly-summary-goal-progress {
  color: var(--text-subtle);
  font-size: 0.875rem;
}

.weekly-summary-reflection {
  color: var(--text-label);
  white-space: pre-wrap;
  margin: 0;
}

.gt-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--neutral-500);
  padding: 0.75rem 1rem 0.25rem;
  margin: 0;
}

.gt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font-ui);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-fast);
  line-height: 1.4;
}

.gt-btn--primary {
  background: var(--secondary);
  color: var(--text-on-accent);
}

.gt-btn--primary:hover {
  background: var(--secondary-hover);
  color: var(--text-on-accent);
}

.gt-btn--secondary {
  background: var(--neutral-100);
  color: var(--neutral-900);
}

.gt-btn--secondary:hover {
  background: var(--neutral-200);
}

.gt-btn--ghost {
  background: transparent;
  color: var(--secondary);
  border: 1px solid var(--neutral-200);
}

.gt-empty-state {
  text-align: center;
  padding: var(--space-xl);
  color: var(--neutral-500);
}

.gt-empty-state h3 {
  font-family: var(--font-display);
  color: var(--neutral-900);
  margin: 0.5rem 0;
}

.gt-empty-state p {
  margin: 0 0 var(--space-md);
}

/* --- Search page --- */
.search-page {
  max-width: 720px;
}

.search-hero-form {
  margin-bottom: var(--space-lg);
}

.search-hero-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-hero-icon {
  position: absolute;
  left: 1.125rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--neutral-500);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-hero-input {
  width: 100%;
  padding: 0.875rem 2.75rem 0.875rem 3rem;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-ui);
  background: var(--surface-raised);
  color: var(--neutral-900);
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.search-hero-input::placeholder {
  color: var(--neutral-500);
}

.search-hero-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px hsla(var(--secondary-base), 0.15);
}

.search-hero-clear {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: var(--neutral-500);
  text-decoration: none;
  transition: var(--transition-fast);
}

.search-hero-clear:hover {
  background: var(--neutral-100);
  color: var(--neutral-900);
}

.search-empty-prompt {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  background: var(--surface-raised);
  border: 1px dashed var(--neutral-200);
  border-radius: var(--radius);
}

.search-empty-prompt__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.search-empty-prompt__title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--neutral-900);
  margin: 0 0 0.375rem;
}

.search-empty-prompt__desc {
  font-size: 0.9375rem;
  color: var(--neutral-500);
  margin: 0;
  max-width: 28rem;
  margin-inline: auto;
}

.search-results-meta {
  font-size: 0.875rem;
  color: var(--neutral-500);
  margin: 0 0 var(--space-md);
}

.search-results-meta strong {
  color: var(--neutral-900);
  font-weight: 600;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.search-section__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.search-section__title {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--neutral-500);
  margin: 0;
}

.search-section__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.375rem;
  border-radius: 999px;
  background: var(--neutral-100);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--neutral-700);
}

.search-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.search-result-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.125rem;
  background: var(--surface-raised);
  border: 1px solid var(--neutral-100);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.search-result-card:hover {
  border-color: var(--neutral-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.search-result-card__body {
  flex: 1;
  min-width: 0;
}

.search-result-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.search-result-card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--neutral-900);
  line-height: 1.35;
}

.search-result-card__badge {
  display: inline-flex;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-subtle);
  color: var(--secondary);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.search-result-card__date {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 0.375rem;
}

.search-result-card__desc {
  font-size: 0.875rem;
  color: var(--neutral-500);
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-card__desc--quote {
  font-style: italic;
}

.search-result-card__arrow {
  flex-shrink: 0;
  color: var(--neutral-300);
  transition: var(--transition-fast);
}

.search-result-card:hover .search-result-card__arrow {
  color: var(--secondary);
  transform: translateX(2px);
}

.search-result-card mark {
  background: hsla(var(--accent-base), 0.25);
  color: inherit;
  border-radius: 2px;
  padding: 0 0.1em;
}

@media (max-width: 768px) {
  .search-hero-input {
    font-size: 0.9375rem;
    padding: 0.75rem 2.5rem 0.75rem 2.75rem;
  }

  .search-result-card__top {
    flex-direction: column;
    align-items: flex-start;
  }
}

.gt-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.gt-modal.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.gt-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 16, 26, 0.45);
}

.gt-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 32rem;
  max-height: 90vh;
  overflow: auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.gt-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--neutral-100);
}

.gt-modal__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.gt-modal__close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--neutral-700);
  line-height: 1;
}

.gt-modal__body {
  padding: var(--space-lg);
}

.gt-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--neutral-100);
}

/* Sidebar nav groups */
.user-sidebar-nav-group {
  margin-bottom: 0.25rem;
}

.user-sidebar-nav-group + .user-sidebar-nav-group {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--neutral-100);
}

/* Dashboard tiers */
.dashboard-more {
  margin-top: var(--space-md);
  border: 1px solid var(--neutral-100);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
}

.dashboard-more-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--neutral-900);
  list-style: none;
}

.dashboard-more-summary::-webkit-details-marker {
  display: none;
}

.dashboard-more-summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--neutral-500);
  border-bottom: 2px solid var(--neutral-500);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.dashboard-more[open] .dashboard-more-summary::after {
  transform: rotate(-135deg);
}

.dashboard-more-body {
  padding: 0 var(--space-md) var(--space-md);
}

.dashboard-more-body .dashboard-v2__row--paired {
  margin-bottom: var(--space-md);
}

/* Today dashboard (user-centric rebuild) */
.today-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: var(--space-xl);
}

@media (min-width: 960px) {
  .today-dashboard {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    align-items: start;
  }

  .today-dashboard__rail {
    position: sticky;
    top: var(--space-md);
  }
}

.today-dashboard__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  min-width: 0;
}

.today-hero {
  padding: var(--space-md) 0 0;
}

.today-hero__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.today-hero__greeting {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-heading);
  line-height: 1.2;
}

.today-hero__date {
  margin: 0.25rem 0 0;
  color: var(--neutral-500);
  font-size: 0.9375rem;
}

.today-hero__count {
  margin: 0;
  font-size: 1rem;
  color: var(--neutral-700);
  text-align: right;
}

.today-hero__count strong {
  color: var(--secondary);
  font-size: 1.25rem;
}

.today-hero__progress {
  height: 6px;
  background: var(--neutral-100);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.today-hero__progress-fill {
  height: 100%;
  background: var(--secondary);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.today-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Capture — primary log entry */
.today-capture {
  background: var(--surface-raised);
  border: 2px solid color-mix(in srgb, var(--secondary) 35%, var(--neutral-100));
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
}

.today-capture__title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0;
  color: var(--neutral-900);
}

.today-capture__subtitle {
  margin: 0.375rem 0 0;
  font-size: 0.9375rem;
  color: var(--neutral-600);
  line-height: 1.45;
}

.today-capture__body {
  margin-top: var(--space-md);
}

.today-capture__body .quick-log-card--slim {
  border: none;
  padding: 0;
  box-shadow: none;
}

.today-capture__footer {
  margin: var(--space-md) 0 0;
  font-size: 0.875rem;
}

.today-capture__pick-link {
  color: var(--secondary);
  font-weight: 600;
  text-decoration: none;
}

.today-capture__pick-link:hover {
  text-decoration: underline;
}

.today-checklist__heading {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 var(--space-md);
  color: var(--neutral-900);
}

.today-checklist__section-label {
  padding-left: 0;
  margin-top: var(--space-md);
}

.today-checklist__group {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.today-checklist__item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0.875rem var(--space-md);
  min-height: 56px;
  border-bottom: 1px solid var(--neutral-100);
}

.today-checklist__item:last-child {
  border-bottom: none;
}

.today-checklist__main {
  flex: 1;
  min-width: 0;
}

.today-checklist__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.today-checklist__link:hover .today-checklist__name {
  color: var(--secondary);
}

.today-checklist__name {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--neutral-900);
}

.today-checklist__meta {
  display: block;
  font-size: 0.8125rem;
  color: var(--neutral-500);
  margin-top: 0.125rem;
}

.today-checklist__progress {
  height: 4px;
  background: var(--neutral-100);
  border-radius: 999px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.today-checklist__progress-fill {
  height: 100%;
  background: var(--secondary);
  border-radius: 999px;
}

.today-checklist__action {
  flex-shrink: 0;
}

.today-checklist__check-btn {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

.today-checklist__check-btn:hover svg circle {
  stroke: var(--secondary);
}

.today-checklist__form {
  margin: 0;
}

.today-week-strip {
  padding: var(--space-md) 0;
  border-top: 1px solid var(--neutral-100);
}

.today-week-strip__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.today-week-strip__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--neutral-700);
}

.today-week-strip__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.today-week-strip__chip {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  background: var(--neutral-100);
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--neutral-900);
  text-decoration: none;
}

.today-week-strip__chip:hover {
  background: var(--secondary);
  color: var(--white);
}

.today-week-strip__link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--secondary);
  text-decoration: none;
}

.today-insights {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.today-insights__card {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.today-insights__card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.today-insights__title {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0;
  color: var(--neutral-900);
}

.today-insights__link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--secondary);
  text-decoration: none;
}

.today-insights__text,
.today-insights__meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--neutral-700);
  line-height: 1.5;
}

.today-insights__meta {
  color: var(--neutral-500);
  margin-bottom: 0.5rem;
}

.today-insights__sessions {
  list-style: none;
  margin: 0;
  padding: 0;
}

.today-insights__sessions li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--neutral-100);
  font-size: 0.875rem;
}

.today-insights__sessions li:last-child {
  border-bottom: none;
}

.today-insights__quote {
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--neutral-500);
  margin: 0;
  padding: 0 var(--space-sm);
}

.today-insights__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding-top: var(--space-sm);
}

.today-insights__nav-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--secondary);
  text-decoration: none;
}

.today-insights__nav-link:hover {
  text-decoration: underline;
}

.quick-log-card--slim {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.quick-log-card__body {
  padding: 0;
}

.quick-log-card__hint--slim {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
}

/* Goal card menu */
.goals-card-menu-wrap {
  position: relative;
}

.goals-card-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 20;
  min-width: 8.5rem;
  background: var(--white);
  border: 1px solid var(--neutral-100);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 0.25rem;
  display: none;
}

.goals-card-menu-dropdown.is-open {
  display: block;
}

.goals-card-menu-dropdown a,
.goals-card-menu-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--neutral-900);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

.goals-card-menu-dropdown a:hover,
.goals-card-menu-dropdown button:hover {
  background: var(--neutral-50);
}

/* Goal detail tabs */
.goal-detail-tabs {
  margin-top: var(--space-lg);
  border-top: 1px solid var(--neutral-100);
  padding-top: var(--space-md);
}

.goal-detail-tabs-nav {
  display: flex;
  gap: 0.25rem;
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--neutral-100);
}

.goal-detail-tab-btn {
  padding: 0.625rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--neutral-500);
  cursor: pointer;
  margin-bottom: -1px;
}

.goal-detail-tab-btn.is-active {
  color: var(--secondary);
  border-bottom-color: var(--secondary);
}

.goal-detail-tab-panel {
  display: none;
}

.goal-detail-tab-panel.is-active {
  display: block;
}

/* Button aliases during migration */
.goals-add-button,
.reflection-journal-add-btn,
.sessions-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  background: var(--secondary);
  color: var(--text-on-accent);
}

.goals-add-button:hover,
.reflection-journal-add-btn:hover,
.sessions-add-btn:hover {
  background: var(--secondary-hover);
  color: var(--text-on-accent);
}

.goals-browse-button {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.25rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  background: var(--neutral-100);
  color: var(--neutral-900);
  margin-left: 0.5rem;
}

.user-navbar-center--hidden {
  display: none;
}

.goal-form-steps-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--neutral-100);
}

.goal-form-step-indicator {
  flex: 1;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--neutral-500);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

.goal-form-step-indicator.is-active {
  background: var(--secondary);
  color: var(--text-on-accent);
}

.goal-form-step-indicator.is-done {
  color: var(--success);
}

.goal-form-step {
  display: none;
}

.goal-form-step.is-active {
  display: block;
}

.goal-form-steps-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-ui);
  line-height: 1.6;
  color: var(--gray-900);
  background: var(--gray-50);
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Navigation */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  color: var(--gray-700);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--text-heading);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-900);
}

.btn-secondary:hover {
  background: var(--gray-300);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-success:hover {
  background: var(--secondary-dark);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-100);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
}

.card-body {
  color: var(--gray-700);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--gray-700);
}

.form-control {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--text-heading);
  box-shadow: 0 0 0 3px rgb(99 102 241 / 0.1);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

select.form-control {
  cursor: pointer;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.alert-error,
.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

/* Progress */
.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-circle {
  transition: stroke-dashoffset 0.35s;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.progress-bar {
  width: 100%;
  height: 0.5rem;
  background: var(--gray-200);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
}

/* Grid */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Goal Cards */
.goal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  border-left: 4px solid var(--primary);
}

/* Onboarding selected-goals banner (legacy) */
.onboarding-selected-banner {
  margin-top: 2rem;
  background: var(--secondary) !important;
  border: none !important;
}

.onboarding-selected-banner .gt-card-body,
.onboarding-selected-banner .gt-card-title {
  color: var(--text-on-accent);
}

.onboarding-selected-banner .gt-card-title {
  margin-bottom: 1rem;
}

.onboarding-selected-banner__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.onboarding-selected-banner__row p {
  margin: 0;
  color: var(--text-on-accent);
}

.onboarding-selected-banner__cta {
  background: #ffffff !important;
  color: hsl(var(--primary-base)) !important;
}

.onboarding-selected-banner__cta:hover {
  background: hsl(210, 40%, 96%) !important;
  color: hsl(var(--primary-base)) !important;
}

.goal-card-content {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.goal-description {
  color: var(--gray-600);
  margin-bottom: 1rem;
  flex: 1;
}

.goal-card-action {
  padding: 0 1.5rem 1.5rem 1.5rem;
  margin-top: auto;
}

.goal-card-action .btn {
  width: 100%;
}

/* Onboarding — profile & goals setup */
.onboarding-shell {
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
}

.onboarding-shell--wide {
  max-width: 72rem;
  padding-bottom: 6.5rem;
}

.onboarding-progress {
  margin-bottom: 1.75rem;
}

.onboarding-progress__steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 0.5rem;
}

.onboarding-progress__step {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-subtle);
  background: var(--surface-sunken);
  border: 2px solid var(--border-default);
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.onboarding-progress__step.is-active {
  color: var(--text-on-accent);
  background: var(--secondary);
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--secondary) 22%, transparent);
}

.onboarding-progress__step.is-complete {
  color: var(--secondary);
  background: var(--accent-subtle);
  border-color: color-mix(in srgb, var(--secondary) 40%, transparent);
}

.onboarding-progress__connector {
  flex: 1;
  height: 2px;
  min-width: 1.5rem;
  margin: 0 0.35rem;
  background: var(--border-default);
  border-radius: 1px;
}

.onboarding-progress__connector.is-complete {
  background: var(--secondary);
}

.onboarding-progress__label {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-subtle);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.onboarding-hero {
  margin-bottom: 1.5rem;
}

.onboarding-hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.onboarding-hero__subtitle {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-subtle);
  max-width: 38ch;
}

.onboarding-card {
  margin-bottom: 0;
}

.onboarding-form {
  padding: 1.5rem;
}

.onboarding-fieldset {
  border: none;
  margin: 0 0 1.75rem;
  padding: 0;
}

.onboarding-fieldset:last-of-type {
  margin-bottom: 0;
}

.onboarding-fieldset__legend {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-heading);
}

.onboarding-fieldset__hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.onboarding-fieldset__description {
  margin: -0.25rem 0 0.875rem;
  font-size: 0.875rem;
  color: var(--text-subtle);
  line-height: 1.45;
}

.onboarding-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem;
}

.onboarding-choice-grid--profile {
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
}

.onboarding-choice {
  position: relative;
  cursor: pointer;
  margin: 0;
}

.onboarding-choice__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.onboarding-choice__surface {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--border-default);
  background: var(--surface-raised);
  color: var(--text-body);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  transition: var(--transition-fast);
  user-select: none;
}

.onboarding-choice--chip .onboarding-choice__surface {
  justify-content: flex-start;
  text-align: left;
}

.onboarding-choice__emoji {
  font-size: 1.125rem;
  line-height: 1;
  flex-shrink: 0;
}

.onboarding-choice__label {
  line-height: 1.25;
}

.onboarding-choice:hover .onboarding-choice__surface {
  border-color: color-mix(in srgb, var(--secondary) 45%, var(--border-default));
  background: var(--surface-sunken);
}

.onboarding-choice__input:focus-visible + .onboarding-choice__surface {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

.onboarding-choice__input:checked + .onboarding-choice__surface {
  border-color: var(--secondary);
  background: var(--accent-subtle);
  color: var(--secondary);
  font-weight: 600;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--secondary) 25%, transparent);
}

.onboarding-choice-grid--profile .onboarding-choice__surface {
  flex-direction: column;
  min-height: 5.5rem;
  padding: 1rem 0.75rem;
  gap: 0.35rem;
}

.onboarding-choice-grid--profile .onboarding-choice__emoji {
  font-size: 1.5rem;
}

.onboarding-form__actions {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-default);
}

.onboarding-form__submit {
  width: 100%;
  padding: 0.875rem 1.25rem !important;
  font-size: 1rem !important;
  border-radius: var(--radius) !important;
}

.onboarding-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.onboarding-goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
}

.onboarding-goal-card {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  padding: 0;
  transition: var(--transition-fast);
}

.onboarding-goal-card--selected {
  border-color: color-mix(in srgb, var(--secondary) 50%, var(--border-default));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--secondary) 20%, transparent);
}

.onboarding-goal-card__body {
  flex: 1;
  padding: 1.25rem 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.onboarding-goal-card__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.onboarding-goal-card__category {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-subtle);
}

.onboarding-goal-card__type {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--secondary);
  background: var(--accent-subtle);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.onboarding-goal-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.3;
}

.onboarding-goal-card__description {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-label);
}

.onboarding-goal-card__schedule {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

.onboarding-goal-card__action {
  padding: 0 1.25rem 1.25rem;
  margin-top: auto;
}

.onboarding-goal-card__btn {
  width: 100%;
  justify-content: center;
  border-radius: var(--radius-sm) !important;
}

.onboarding-goal-card__btn--selected {
  background: var(--accent-subtle) !important;
  color: var(--secondary) !important;
  border: 1.5px solid color-mix(in srgb, var(--secondary) 35%, transparent) !important;
  font-weight: 600;
}

.onboarding-goal-card__btn--selected:hover {
  background: color-mix(in srgb, var(--secondary) 12%, var(--accent-subtle)) !important;
}

.onboarding-empty {
  margin-bottom: 0;
}

.onboarding-empty__body {
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.onboarding-empty__icon {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.onboarding-empty__title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  color: var(--text-heading);
}

.onboarding-empty__text {
  margin: 0 0 1.25rem;
  color: var(--text-subtle);
  font-size: 0.9375rem;
}

.onboarding-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 0.875rem 1rem calc(0.875rem + env(safe-area-inset-bottom, 0px));
  background: var(--surface-overlay);
  backdrop-filter: blur(var(--backdrop-blur));
  border-top: 1px solid var(--border-default);
  transform: translateY(0);
  transition: var(--transition-smooth);
}

.onboarding-footer__inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.onboarding-footer__summary {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}

.onboarding-footer__count {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1;
}

.onboarding-footer__label {
  font-size: 0.875rem;
  color: var(--text-subtle);
}

.onboarding-footer__cta {
  flex-shrink: 0;
  min-width: 9rem;
  padding: 0.75rem 1.5rem !important;
}

.onboarding-footer__cta:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

[data-theme="dark"] .onboarding-choice__input:checked + .onboarding-choice__surface {
  color: var(--secondary);
}

[data-theme="dark"] .onboarding-footer {
  background: color-mix(in srgb, var(--surface-page) 92%, transparent);
}

@media (max-width: 540px) {
  .onboarding-choice-grid {
    grid-template-columns: 1fr;
  }

  .onboarding-choice-grid--profile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .onboarding-footer__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .onboarding-footer__cta {
    width: 100%;
  }
}

/* Legacy category selection (deprecated — use onboarding-choice) */
.category-selection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.category-selection-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 2px solid var(--border-default);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface-raised);
}

.category-selection-card:hover {
  border-color: color-mix(in srgb, var(--secondary) 45%, var(--border-default));
  background: var(--surface-sunken);
}

.category-checkbox {
  margin: 0;
  cursor: pointer;
}

.category-checkbox:checked + .category-selection-label {
  font-weight: 600;
  color: var(--secondary);
}

.category-selection-card:has(.category-checkbox:checked) {
  border-color: var(--secondary);
  background: var(--accent-subtle);
}

.category-selection-label {
  cursor: pointer;
  user-select: none;
  flex: 1;
  color: var(--text-body);
}

.category-selection-card:has(.category-checkbox:checked) .category-selection-label {
  color: var(--secondary);
}

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

.goal-card.overdue {
  border-left-color: var(--danger);
}

.goal-card.completed {
  border-left-color: var(--success);
  opacity: 0.8;
}

.goal-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.goal-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}

.goal-category {
  font-size: 0.875rem;
  color: var(--gray-500);
  text-transform: uppercase;
}

.goal-meta {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--white);
}

.badge-success {
  background: var(--success);
  color: var(--white);
}

.badge-danger {
  background: var(--danger);
  color: var(--white);
}

.badge-warning {
  background: var(--warning);
  color: var(--white);
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mt-4 {
  margin-top: 2rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

.mb-4 {
  margin-bottom: 2rem;
}

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-2 {
  gap: 1rem;
}

/* Login/Signup Pages */
/* Login Page - New Design */
.login-page-container {
  /* Auth pages always use a fixed light palette (independent of global dark theme) */
  --login-page-bg: #F5F7FA;
  --login-surface: #ffffff;
  --login-text: hsl(210, 15%, 12%);
  --login-text-heading: hsl(206, 80%, 6%);
  --login-text-muted: hsl(210, 10%, 45%);
  --login-text-subtle: hsl(210, 10%, 57%);
  --login-border: hsl(210, 20%, 90%);
  --login-border-strong: hsl(210, 16%, 82%);
  --login-surface-hover: hsl(210, 40%, 98%);
  --login-on-accent: #ffffff;
  color-scheme: light;

  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 100vh;
  display: flex;
  z-index: 1;
  padding: 30px;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--login-text-heading);
  background: var(--login-page-bg);
  overflow: hidden;
  /* Prevent body scroll */
}

/* Override container padding for login page */
body:not(.user-body) main.container {
  padding: 0 !important;
  max-width: 100% !important;
}

.login-form-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 3rem 2rem;
  background: var(--login-page-bg);
  overflow-y: auto;
  /* Enable internal scroll */
  height: 100%;
}

.login-form-wrapper {
  margin: auto;
  width: 100%;
  max-width: 420px;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.login-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo-text {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--login-text);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.login-form {
  width: 100%;
}

.login-form-group {
  margin-bottom: 1.25rem;
}

.login-form-group:last-of-type {
  margin-bottom: 0;
}

.login-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--login-text-heading);
  margin-bottom: 0.5rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.login-input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  color: var(--login-text);
  background: var(--login-surface);
  border: 1px solid var(--login-border);
  border-radius: 8px;
  transition: all 0.2s;
  box-sizing: border-box;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.login-password-wrapper .login-input {
  padding-right: 3rem;
  /* Space for eye icon */
}

.login-input:focus {
  outline: none;
  border-color: var(--login-text-heading);
  box-shadow: 0 0 0 3px rgba(68, 122, 237, 0.1);
}

.login-password-wrapper {
  position: relative;
}

.login-password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--login-text-subtle);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-password-toggle:hover {
  color: var(--login-text-muted);
}

.login-forgot-password {
  text-align: right;
  margin-bottom: 1.5rem;
}

.login-forgot-link {
  font-size: 0.875rem;
  color: #0094E9;
  /* Theme blue */
  text-decoration: none;
  font-weight: 600;
  /* Semibold */
}

.login-forgot-link:hover {
  text-decoration: underline;
}

.login-submit-btn {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--login-on-accent);
  background: #9CA3AF;
  /* Grey background */
  border: none;
  border-radius: 30px;
  /* Rounded like theme */
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.login-submit-btn:hover {
  background: #6B7280;
}

.login-divider {
  position: relative;
  text-align: center;
  margin: 2rem 0;
  color: var(--login-text-subtle);
  font-size: 0.875rem;
}

.login-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-bottom: 1px solid var(--login-border);
  z-index: 0;
}

.login-divider span {
  position: relative;
  background: var(--login-page-bg);
  padding: 0 1rem;
  z-index: 1;
  font-style: italic;
  /* Slightly italic */
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--login-text-subtle);
}

.login-social-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.login-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 30px;
  /* Rounded like theme */
  transition: all 0.2s;
  border: 1px solid var(--login-border);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.login-google-btn {
  background: var(--login-surface);
  color: var(--login-text-heading);
}

.login-google-btn:hover {
  background: var(--login-surface-hover);
  border-color: var(--login-border-strong);
}

.login-apple-btn {
  background: var(--login-surface);
  color: var(--login-text-heading);
}

.login-apple-btn svg {
  color: var(--login-text);
}

.login-apple-btn:hover {
  background: var(--login-surface-hover);
  border-color: var(--login-border-strong);
}

.login-signup-link {
  text-align: center;
  font-size: 0.875rem;
  color: var(--login-text-muted);
  margin-top: 1rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.login-error-alert {
  background: #FEE2E2;
  border: 1px solid #FECACA;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.login-error-alert ul {
  margin: 0;
  padding-left: 1.5rem;
  list-style: disc;
}

.login-error-alert li {
  color: #DC2626;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.login-error-alert li:last-child {
  margin-bottom: 0;
}

/* Goal Template Page */
.goal-template-page {
  /* padding: 2rem 0; */
}

.goal-template-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.goal-template-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goal-template-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.goal-template-filter-chip {
  padding: 0.625rem 1.25rem;
  border-radius: 30px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-default);
  color: var(--text-label);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goal-template-filter-chip:hover {
  background: var(--surface-raised);
  border-color: var(--neutral-300);
}

.goal-template-filter-chip.active {
  background: var(--accent-subtle);
  color: var(--secondary);
  border-color: color-mix(in srgb, var(--secondary) 35%, transparent);
}

.goal-template-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.goal-template-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.2s;
}

.goal-template-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--neutral-300);
}

.goal-template-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.goal-template-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.goal-template-icon.wellness {
  background: #D1FAE5;
  border: 2px solid #059669;
}

.goal-template-icon.wellness svg path {
  stroke: #059669;
  fill: none;
}

.goal-template-icon.learning {
  background: #FED7AA;
}

.goal-template-icon.productivity {
  background: #C8E5F7;
}

.goal-template-icon.community-service,
.goal-template-icon.community-services {
  background: #E0E7FF;
}

.goal-template-icon.personal-development {
  background: #FCE7F3;
}

.goal-template-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
  flex: 1;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goal-template-card-description {
  font-size: 14px;
  color: var(--text-heading);
  margin: 0;
  line-height: 1.5;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goal-template-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.goal-template-tracking {
  display: flex;
  align-items: center;
}

.goal-template-tracking-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 14px;
  color: var(--text-subtle);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goal-template-tracking-item svg {
  color: var(--text-subtle);
  flex-shrink: 0;
}

.goal-template-frequency-badge {
  padding: 0.375rem 0.875rem;
  background: var(--accent-subtle);
  color: var(--secondary);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goal-template-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Template Details Sidebar */
.template-details-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.template-details-sidebar.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.template-details-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.template-details-sidebar.active .template-details-overlay {
  opacity: 1;
}

.template-details-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100%;
  background: var(--white);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  z-index: 1001;
}

.template-details-sidebar.active .template-details-panel {
  transform: translateX(0);
}

.template-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: none;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 10;
}

.template-details-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.template-details-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  border-radius: 6px;
  transition: all 0.2s;
}

.template-details-close:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.template-details-content {
  padding: 0 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.template-details-summary-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.template-details-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0;
}

.template-details-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.template-details-title-section {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
  flex-wrap: wrap;
}

.template-details-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.template-details-category {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.template-details-description {
  font-size: 14px;
  color: var(--text-heading);
  line-height: 1.6;
  margin: 0;
  margin-top: 0.5rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.template-details-section-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.template-details-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-subtle);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.template-details-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.template-details-detail-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--p);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.template-details-detail-item svg {
  color: var(--gray-600);
  flex-shrink: 0;
}

.template-details-usage-section-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}


.template-details-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.template-details-section-header svg {
  color: var(--gray-700);
  flex-shrink: 0;
}

.template-details-section-header h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.template-details-section-subtitle {
  font-size: 14px;
  color: var(--text-subtle);
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.template-details-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.template-details-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  align-items: center;
  color: var(--gray-700);
  line-height: 1.5;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.template-details-list li svg {
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.template-details-add-btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--secondary);
  color: var(--text-on-accent);
  border: none;
  border-radius: 30px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.template-details-add-btn:hover {
  background: var(--secondary-hover);
}

.template-details-disclaimer {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-align: center;
  margin: 0.5rem 0 0 0;
  font-style: italic;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Responsive */
@media (max-width: 1200px) {
  .goal-template-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .goal-template-cards-grid {
    grid-template-columns: 1fr;
  }
}

.login-signup-btn {
  color: #0094E9;
  /* Theme blue */
  text-decoration: none;
  font-weight: 600;
  /* Semibold */
  margin-left: 0.25rem;
}

.login-signup-btn:hover {
  text-decoration: underline;
}

/* Phone Mockup Section */
.login-phone-section {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(0, 148, 233, .15) 100%);
  position: relative;
  overflow: hidden;
  border-radius: 16px;
}

.login-phone-section img {
  width: 100%;
  max-height: 80vh;
  height: auto;
  object-fit: contain;
  object-position: bottom right;
}

.login-phone-mockup {
  position: relative;
  width: 320px;
  height: 640px;
  background: #000;
  border-radius: 40px;
  padding: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-phone-screen {
  width: 100%;
  height: 100%;
  background: var(--white);
  border-radius: 32px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-900);
}

.phone-status-icons {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.phone-app-content {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.phone-app-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.phone-app-title {
  flex: 1;
}

.phone-app-title h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 0.25rem 0;
}

.phone-app-title span {
  font-size: 0.75rem;
  color: var(--gray-600);
}

.phone-app-redo {
  font-size: 0.875rem;
  color: var(--gray-600);
}

.phone-progress-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.phone-progress-circle-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
}

.phone-progress-circle {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.phone-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.phone-progress-count {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gray-900);
}

.phone-progress-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin: 0;
}

.phone-completion-section {
  background: #EFF5F9;
  padding: 1.25rem;
  border-radius: 12px;
}

.phone-completion-question {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-heading);
  margin: 0 0 1rem 0;
}

.phone-completion-buttons {
  display: flex;
  gap: 0.75rem;
}

.phone-btn-yes,
.phone-btn-no {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s;
}

.phone-btn-yes {
  background: var(--primary);
  color: var(--white);
}

.phone-btn-yes.active {
  background: var(--primary);
}

.phone-btn-no {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.phone-history-section {
  margin-top: 0.5rem;
}

.phone-history-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 0.75rem 0;
}

.phone-history-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.phone-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.phone-history-item:last-child {
  border-bottom: none;
}

.phone-history-date {
  font-size: 0.75rem;
  color: var(--gray-700);
}

.phone-history-status {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

.phone-history-status.completed {
  background: #D1FAE5;
  color: #059669;
}

.phone-history-status.not-completed {
  background: var(--gray-200);
  color: var(--gray-600);
}

.phone-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 1rem;
}

.phone-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.2s;
}

.phone-action-btn.delete {
  color: #F04438;
  border-color: #F04438;
}

.phone-action-btn:hover {
  background: var(--gray-50);
}

/* Responsive */
@media (max-width: 1024px) {
  .login-page-container {
    flex-direction: column;
  }

  .login-phone-section {
    display: none;
  }

  .login-form-section {
    padding: 2rem 1.5rem;
  }
}

/* Old auth styles for backward compatibility */
.auth-container {
  --login-page-bg: #F5F7FA;
  --login-surface: #ffffff;
  --login-text: hsl(210, 15%, 12%);
  --login-text-heading: hsl(206, 80%, 6%);
  --login-text-muted: hsl(210, 10%, 45%);
  --login-text-subtle: hsl(210, 10%, 57%);
  --login-border: hsl(210, 20%, 90%);
  color-scheme: light;

  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, hsl(206, 80%, 6%) 0%, hsl(206, 80%, 4%) 100%);
  padding: 2rem;
}

.auth-card {
  background: var(--login-surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
}

.auth-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--login-text);
  margin-bottom: 0.5rem;
  text-align: center;
}

.auth-subtitle {
  text-align: center;
  color: var(--login-text-muted);
  margin-bottom: 2rem;
}

.auth-container .form-label {
  color: var(--login-text-muted);
}

.auth-container .form-control {
  color: var(--login-text);
  background: var(--login-surface);
  border-color: var(--login-border);
}

.auth-container .form-control:focus {
  border-color: var(--login-text-heading);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--login-border);
}

.auth-divider span {
  padding: 0 1rem;
  color: var(--login-text-subtle);
  font-size: 0.875rem;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.btn-google:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.btn-google svg {
  flex-shrink: 0;
}

.btn-apple {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--gray-900);
  color: var(--white);
  border: 1px solid var(--gray-900);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.btn-apple:hover {
  background: var(--gray-800);
  border-color: var(--gray-800);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  color: var(--white);
}

.btn-apple svg {
  flex-shrink: 0;
}

/* Dashboard */
.dashboard-header {
  margin-bottom: 2rem;
}

.dashboard-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.dashboard-subtitle {
  color: var(--gray-600);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

/* Filter Chips */
.filter-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filter-chip {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.filter-chip:hover,
.filter-chip.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--text-heading);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Admin Sidebar */
.admin-body {
  display: flex;
  min-height: 100vh;
  background: var(--gray-50);
  margin: 0;
  padding: 15px 0 0 15px;
  overflow-x: hidden;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Apply DM Sans font to all admin elements */
.admin-body,
.admin-body *,
.admin-sidebar,
.admin-sidebar *,
.admin-main,
.admin-main *,
.admin-content,
.admin-content *,
[class^="admin-"],
[class^="admin-"] * {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.admin-sidebar {
  width: 280px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 15px;
  top: 15px;
  bottom: 15px;
  height: calc(100vh - 30px);
  z-index: 1000;
  overflow: hidden;
  /* box-shadow: 4px 0 12px rgba(0, 0, 0, 0.06); */
  transition: transform 0.3s ease, width 0.3s ease, padding 0.3s ease;
  border-radius: 16px 16px 0px 0;
  margin: 0;
  padding: 30px;
}

.sidebar-header {
  padding: 0 0 30px;
  border-bottom: 1px solid var(--gray-100);
  background: var(--white);
  border-radius: 0 24px 0 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  color: var(--gray-900);
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
  position: relative;
}

.sidebar-logo-link {
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
  display: inline-block;
}

.sidebar-logo-link:hover {
  opacity: 0.8;
}

.logo-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.logo-circle .logo-icon {
  width: 18px;
  height: 18px;
  stroke: var(--white);
  fill: none;
  display: block;
}

.sidebar-logo-image {
  width: 145px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.logo-text {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--gray-900);
  flex: 1;
}

.sidebar-collapse-btn,
.logo-menu-icon {
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  margin-left: 0;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.3s ease;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  position: relative;
  flex-shrink: 0;
  z-index: 10;
  border: 1px solid var(--gray-100);
  background: var(--white);
}

.sidebar-collapse-btn {
  appearance: none;
  -webkit-appearance: none;
}

.logo-menu-icon:hover {
  opacity: 1;
  background: var(--gray-50);
}

.logo-menu-icon:active {
  opacity: 1;
  background: var(--gray-100);
}

.logo-menu-icon .expand-arrow {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease, margin-left 0.3s ease;
  display: block;
}

/* Collapsed sidebar state */
.admin-sidebar {
  transition: width 0.3s ease, padding 0.3s ease;
}

.admin-sidebar.collapsed {
  width: 80px;
  padding: 24px 12px;
  overflow: visible;
}

.admin-sidebar.collapsed .sidebar-header {
  padding: 0 0 20px;
}

.admin-sidebar.collapsed .sidebar-logo {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}

.admin-sidebar.collapsed .sidebar-logo-link,
.admin-sidebar.collapsed .sidebar-logo-image {
  display: none;
}

.admin-sidebar.collapsed .sidebar-collapse-btn,
.admin-sidebar.collapsed .logo-menu-icon {
  display: flex !important;
  margin: 0;
  opacity: 1;
  position: static;
  transform: none;
}

.admin-sidebar.collapsed .logo-menu-icon:hover {
  background: var(--gray-50);
}

.admin-sidebar.collapsed .logo-menu-icon .expand-arrow {
  transform: rotate(180deg);
}

.admin-sidebar.collapsed .sidebar-text {
  display: none;
}

.admin-sidebar.collapsed .sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  padding: 0;
  overflow: hidden;
  overflow-x: visible;
}

.admin-sidebar.collapsed .sidebar-link {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem;
  width: 100%;
}

.admin-sidebar.collapsed .sidebar-icon {
  display: flex;
  margin: 0;
}

.admin-sidebar.collapsed~.admin-main {
  margin-left: calc(15px + 80px + 12px);
  width: calc(100% - 15px - 80px - 12px);
  transition: margin-left 0.3s ease, width 0.3s ease;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  padding: 1.25rem 0 1.5rem 0;
  overflow: hidden;
  overflow-x: visible;
  position: relative;
  border-radius: 0 0 24px 0;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  margin: 0;
  color: var(--text-heading);
  text-decoration: none;
  font-weight: 400;
  transition: all 0.2s ease;
  position: relative;
  border-radius: 8px;
}

.sidebar-link:hover {
  background: #F5FAFD;
  color: #0094E9;
}

.sidebar-link:hover svg path {
  stroke: #0094E9;
}

.sidebar-link.active {
  background: #F5FAFD;
  color: #0094E9;
}

.sidebar-link.active svg path {
  stroke: #0094E9;
}



.sidebar-link.active .sidebar-icon {
  color: var(--text-heading);
}

.sidebar-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--gray-600);
}

.sidebar-icon svg {
  width: 100%;
  height: 100%;
}

.sidebar-text {
  font-size: 14px;
  color: inherit;
  line-height: 1.5;
}

.admin-main {
  flex: 1;
  margin-left: 280px;
  min-height: 100vh;
  transition: margin-left 0.3s ease, width 0.3s ease;
  width: calc(100% - 280px);
}

.admin-content {
  max-width: 100%;
  margin: 0;
  padding: 0 2rem 20px 2rem;
}

/* Admin Page Header */
.admin-page-header {
  background: var(--white);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--gray-100);
}

.admin-header-left {
  display: flex;
  align-items: center;
}

.admin-header-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-heading);
  margin: 0;
}

/* Pages with their own h1 (templates, missions, etc.) */
.admin-content:has(.admin-templates-header) .admin-page-header {
  margin-bottom: 0.75rem;
}

.admin-content:has(.admin-templates-header) .admin-header-title {
  display: none;
}

.admin-sidebar.collapsed ~ .admin-main .admin-page-header .admin-header-left {
  padding-left: 1rem;
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: .5rem;

}

.admin-notification-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
  border-right: 1px solid #F0F1F3;
}

.admin-notification-btn:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}

.admin-user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border-radius: 12px;
  transition: background 0.2s;
}

.admin-user-profile:hover {
  background: var(--gray-50);
}

.admin-profile-picture {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.admin-profile-initial {
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
}

.admin-user-info {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.admin-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.4;
}

.admin-user-role {
  font-size: 11px;
  color: var(--text-subtle);
  line-height: 1.4;
}

.admin-dropdown-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  margin-left: 0.25rem;
  pointer-events: none;
}

.admin-dropdown-btn:hover {
  color: var(--gray-900);
}

.admin-user-profile {
  position: relative;
}

.admin-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: white;
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  min-width: 180px;
  z-index: 1000;
  overflow: hidden;
}

.admin-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--gray-700);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  font-size: 14px;
  font-weight: 400;
  border: none;
  width: 100%;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.admin-dropdown-item:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}

.admin-dropdown-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Admin Statistics Cards */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.admin-stat-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.admin-stat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-stat-icon img {
  object-fit: contain;
}

.admin-stat-icon-orange {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
}

.admin-stat-icon-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.admin-stat-icon-green {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.admin-stat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-stat-title {
  font-size: 16px;
  color: var(--text-heading);
  margin: 0;
  font-weight: 600;
}

.admin-stat-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-stat-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.admin-stat-badge {
  display: inline-block;
  padding: 3px 12px;
  background: #E7F8F0;
  color: #0D824B;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

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

@media (max-width: 768px) {
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin Dashboard Cards */
.admin-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.admin-dashboard-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--gray-100);
}

.admin-card-header {
  margin-bottom: 1.5rem;
}

.admin-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-heading);
}

.admin-card-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-subtle);
  margin: 0;
}

/* Popular Templates */
.admin-template-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.admin-template-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 0 10px 0;
}

.admin-template-item:last-child {
  border-bottom: none;
}

.admin-rank-badge {
  width: 48px;
  height: 44px;
  border-radius: 8px;
  background: #ECF2FD;
  color: #447AED;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}

.admin-template-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.admin-template-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
  line-height: 1.4;
}

.admin-template-category {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-subtle);
  margin: 0;
  line-height: 1.4;
}

.admin-template-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.375rem;
  flex-shrink: 0;
}

.admin-template-count {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-heading);
  line-height: 1.4;
}

.admin-template-badge {
  display: inline-block;
  padding: 3px 12px;
  background: #E7F8F0;
  color: #0D824B;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
}

/* Recent Reflections */
.admin-reflection-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.admin-reflection-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0 0 15px 0;
}

.admin-reflection-item:last-child {
  padding-bottom: 0;
}

.admin-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.admin-avatar-initial {
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
}

.admin-reflection-info {
  flex: 1;
  min-width: 0;
}

.admin-reflection-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-heading);
  margin: 0;
  line-height: 1.4;
}

.admin-reflection-snippet {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-subtle);
  margin: 0;
  line-height: 1.4;
}

.admin-reflection-time {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--gray-600);
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.admin-reflection-time svg {
  flex-shrink: 0;
}

.admin-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
}

.admin-empty-state p {
  margin: 0 0 1.5rem 0;
  font-size: 1rem;
}

@media (max-width: 1024px) {
  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin Categories Page */
.admin-categories-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
}

.admin-add-category-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 12px 24px;
  height: 48px;
  min-width: 180px;
  background: var(--secondary);
  color: var(--white);
  border-radius: 9999px;
  border: none;
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  transition: all 0.2s;
  cursor: pointer;
}

.admin-add-category-btn:hover {
  background: #0080D1;
  color: var(--white);
}

.admin-add-category-btn svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  stroke: var(--white);
}

.admin-categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.admin-category-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.admin-category-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 5px;
}

.admin-category-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #ECF2FD;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-category-icon-box svg {
  width: 24px;
  height: 24px;
}

.admin-category-icon-box img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.admin-category-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-heading);
  margin: 0;
  flex: 1;
}

.admin-category-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.admin-category-action-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 0;
  transition: all 0.2s;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  padding: 0;
}

/* .admin-edit-btn {
  color: var(--text-subtle);
  border-color: var(--gray-100);
}

.admin-edit-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-100);
}

.admin-delete-btn {
  color: #DC2626;
  border-color: #FEE2E2;
  background: #FEE2E2;
}

.admin-delete-btn:hover {
  background: #FECACA;
  border-color: #FCA5A5;
} */

.admin-category-divider {
  height: 1px;
  background: var(--gray-100);
  margin: 0.875rem 0;
}

.admin-category-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.admin-category-goals {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-heading);
}

.admin-category-goals strong {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-heading);
}

.admin-category-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
}

.admin-category-status.visible {
  background: #E7F8F0;
  color: #0D824B;
}

.admin-category-status.hidden {
  background: rgba(156, 163, 175, 0.15);
  color: var(--gray-500);
}

.admin-category-status svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

@media (max-width: 1024px) {
  .admin-categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .admin-categories-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin Modal */
.admin-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.admin-modal.active {
  display: flex;
}

.admin-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.admin-modal-content {
  position: relative;
  background: var(--white);
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  z-index: 2001;
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 0 1.5rem;
  border-bottom: none;
}

.admin-delete-modal-content .admin-modal-header {
  justify-content: flex-end;
}

.admin-modal-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-heading);
  margin: 0;
  text-align: left;
}

.admin-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.admin-modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.admin-modal-form {
  padding: 1.5rem;
}

.admin-template-modal-content {
  max-width: 640px;
}

.admin-template-modal-content .admin-modal-footer {
  padding: 0 0 1.5rem 0;
}

.admin-category-modal-content {
  max-width: 430px;
}

.admin-category-modal-content .admin-modal-footer {
  padding: 0 0 1.5rem 0;
}

.admin-form-group {
  margin-bottom: 1.5rem;
}

.admin-form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.admin-form-label {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
}

.admin-form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  font-size: 0.9375rem;
  color: var(--gray-900);
  transition: all 0.2s;
  box-sizing: border-box;
  background: var(--white);
}

.admin-form-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(0, 148, 233, 0.1);
}

.admin-form-input select,
select.admin-form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%23565F66' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.admin-icon-selection-wrapper {
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 1rem;
  background: var(--white);
}

.admin-icon-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.admin-icon-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem;
  border: 2px solid #E8E8E8;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  min-height: 52px;
}

.admin-icon-option:hover {
  border-color: var(--text-heading);
  background: rgba(99, 102, 241, 0.05);
}

.admin-icon-option.selected {
  border-color: var(--text-heading);
  background: #ECF2FD;
}

.admin-icon-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

/* Content Type Selection Grid */
.admin-content-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.admin-content-type-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0.75rem;
  border: 1px solid var(--gray-100);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--white);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-heading);
}

.admin-content-type-option:hover {
  border-color: #B0DEF8;
  background: #E6F4FD;
}

.admin-content-type-option:hover span {
  color: #0069A5;
}

.admin-content-type-option:hover svg path {
  stroke: #0069A5;
}

.admin-content-type-option#type_option_quote:hover svg path,
.admin-content-type-option#new_type_option_quote:hover svg path {
  fill: #0069A5;
  stroke: none;
}

.admin-content-type-option#type_option_quote.selected svg path,
.admin-content-type-option#new_type_option_quote.selected svg path {
  fill: #0069A5;
  stroke: none;
}


.admin-content-type-option.selected {
  border-color: #B0DEF8;
  background: #E6F4FD;
}

.admin-content-type-option.selected span {
  color: #0069A5;
}

.admin-content-type-option.selected svg path {
  stroke: #0069A5;
}

.admin-content-type-option svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.admin-content-type-option.selected svg {
  color: var(--text-heading);
}

.admin-content-type-option:not(.selected) svg {
  color: var(--gray-900);
}

.admin-content-type-option span {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
}

/* Video Upload Area */
.admin-upload-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 1.5rem;
  border: 1px solid var(--gray-100);
  border-radius: 10px;
  background: rgb(240, 241, 243, 0.27);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-heading);
  font-weight: normal;
}

.admin-upload-area:hover {
  border-color: var(--gray-100);
  background: rgba(99, 102, 241, 0.02);
  color: var(--text-heading);
}

.admin-upload-area svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.admin-upload-area span {
  font-size: 0.9375rem;
  font-weight: 500;
  color: inherit;
}

.admin-upload-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(240, 241, 243, 0.27);
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  color: var(--text-heading);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-upload-icon-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.admin-upload-icon-btn svg {
  flex-shrink: 0;
}

.admin-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-heading);
  font-weight: 400;
}

.admin-checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--secondary);
  border-radius: 4px;
  border: 2px solid var(--secondary);
}

.admin-checkbox-label input[type="checkbox"]:checked {
  background-color: var(--secondary);
  border-color: var(--secondary);
}

.admin-modal-footer {
  display: flex;
  gap: 0.75rem;
  padding: 0 1.5rem 1.5rem 1.5rem;
  border-top: none;
  margin-top: 0;
}

.admin-modal-btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.9375rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.admin-modal-btn-cancel {
  background: var(--white);
  color: var(--text-heading);
  border: 1px solid var(--gray-100);
  font-weight: 400;
}

.admin-modal-btn-cancel:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.admin-modal-btn-primary {
  background: var(--secondary);
  color: var(--white);
  border: 1px solid var(--secondary);
}

.admin-modal-btn-primary:hover {
  background: #0080D1;
  border-color: #0080D1;
}

/* Delete Modal Specific Styles */
.admin-delete-modal-content {
  max-width: 400px;
  padding-bottom: 1.5rem;
}

.admin-delete-modal-content .admin-modal-footer {
  padding: 0 1.5rem 0 1.5rem;
  margin-top: 0;
}

.admin-delete-modal-body {
  padding: 0 1.5rem 0 1.5rem;
  text-align: center;
}

.admin-delete-modal-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-heading);
  margin: 0 0 0.25rem 0;
}

.admin-delete-warning-icon {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-warning-icon-back {
  position: absolute;
  width: 80px;
  height: 80px;
  background: #dc2626;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  transform: translate(-4px, -4px) rotate(-2deg);
  z-index: 1;
}

.admin-warning-icon-front {
  position: relative;
  width: 80px;
  height: 80px;
  background: rgba(239, 68, 68, 0.25);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.admin-warning-icon-front svg {
  color: #ef4444;
  margin-top: 10px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.admin-delete-confirmation-text {
  font-size: 14px;
  color: var(--gray-600);
  margin: 0 0 1.5rem 0;
  line-height: 1.5;
}

.admin-modal-btn-delete {
  background: var(--secondary);
  color: var(--white);
  border: 1px solid var(--secondary);
}

.admin-modal-btn-delete:hover {
  background: #0080D1;
  border-color: #0080D1;
}

/* Admin Goal Templates Page */
.admin-templates-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.admin-templates-header-left {
  flex: 1;
}

.admin-templates-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
}

.admin-templates-subtitle {
  font-size: 14px;
  color: var(--text-subtle);
  margin: 0;
  font-weight: 400;
}

.admin-templates-header-right {
  display: flex;
  align-items: center;
}

.admin-create-template-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 12px 24px;
  height: 48px;
  background: var(--secondary);
  color: var(--white);
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  transition: all 0.2s;
  cursor: pointer;
}

.admin-create-template-btn:hover {
  background: #0080D1;
  color: var(--white);
}

.admin-create-template-btn svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  stroke: var(--white);
}

.admin-templates-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0;
  padding-bottom: 1rem;
  overflow: visible;
}

.admin-search-box {
  flex: 1 1 240px;
  min-width: 200px;
  position: relative;
  display: flex;
  align-items: center;
  overflow: visible;
}

.admin-search-box svg {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--gray-400);
  pointer-events: none;
  z-index: 1;
}

.admin-search-input {
  width: 100%;
  padding: 0.75rem 0.75rem 0.75rem 2.75rem;
  border: 1px solid #F0F1F3;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-heading);
  transition: all 0.2s;
  background: var(--white);
}

.admin-search-input::placeholder {
  color: var(--text-subtle);
}

.admin-search-input:focus {
  outline: none;
  border-color: var(--text-heading);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.admin-search-input::placeholder {
  color: var(--gray-400);
}

.admin-filter-btn {
  display: inline-flex;
  min-width: 171px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 1px solid #F0F1F3;
  border-radius: 16px;
  color: var(--text-subtle);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.admin-filter-dropdown-wrapper {
  position: relative;
}

.admin-filter-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--white);
  border: 1px solid #F0F1F3;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 200px;
  z-index: 1000;
  padding: 0.5rem 0;
}

.admin-filter-option {
  padding: 0;
}

.admin-filter-link {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-heading);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  transition: all 0.2s;
}

.admin-filter-link:hover {
  background: #F7FBFD;
  color: var(--secondary);
}

.admin-filter-link.active {
  background: #E6F4FD;
  color: var(--secondary);
  font-weight: 500;
}

/* Admin User Show Page */
.admin-user-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.admin-user-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-user-info-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-user-info-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-heading);
}

.admin-weekly-summaries {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-weekly-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #F8FAFD;
  border-bottom: 1px solid #F0F1F3;
}

.admin-weekly-summary-item:last-child {
  border-bottom: none;
}

.admin-weekly-summary-info {
  flex: 1;
  min-width: 0;
}

.admin-weekly-summary-date {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-heading);
  margin-bottom: 0.25rem;
}

.admin-weekly-summary-text {
  font-size: 13px;
  color: var(--text-subtle);
  margin: 0;
}

.admin-weekly-summary-percentage {
  font-size: 16px;
  font-weight: 600;
  color: var(--secondary);
  flex-shrink: 0;
  padding-left: 1rem;
}

.admin-goals-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.admin-goal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: #F7FBFD;
  border-radius: 8px;
  border: 1px solid #E8F4F8;
}

.admin-goal-item--child {
  background: var(--surface-raised);
  border-style: dashed;
}

.admin-goal-info {
  flex: 1;
  min-width: 0;
}

.admin-goal-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-heading);
  margin-bottom: 0.25rem;
}

.admin-goal-meta {
  font-size: 13px;
  color: var(--text-subtle);
  margin: 0;
}

.admin-reflections-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-reflection-item-card {
  padding: 1rem;
  background: #F7FBFD;
  border-radius: 8px;
  border: 1px solid #E8F4F8;
}

.admin-reflection-date {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
}

.admin-reflection-preview {
  font-size: 13px;
  color: var(--text-subtle);
  margin: 0;
  line-height: 1.5;
}

.admin-empty-text {
  color: var(--text-subtle);
  font-size: 14px;
  margin: 0;
  text-align: center;
  padding: 2rem 0;
}

.admin-templates-table-container {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--gray-100);
  padding: 1.25rem;
  overflow: visible;
}

.admin-templates-table-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  margin-top: 1rem;
}

.admin-templates-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-templates-table thead {
  background: var(--white);
}

.admin-templates-table th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: none;
  background: var(--white);
}

.admin-templates-table tr {
  border-bottom: 1px solid #F0F1F3;
  transition: background 0.2s;
}

.admin-templates-table tbody tr:hover {
  background: var(--gray-50);
}

.admin-templates-table tbody tr:last-child {
  border-bottom: none;
}

.admin-templates-table td {
  padding: 1rem 1.25rem;
  font-size: 14px;
  color: var(--text-heading);
  vertical-align: middle;
}

.admin-template-name-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-template-name {
  font-weight: 500;
  color: var(--text-heading);
  font-size: 14px;
  margin: 0;
}

.admin-template-description {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-subtle);
  line-height: 1.4;
  margin: 0;
}

.admin-category-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
}

/* Category tag colors - will be set dynamically based on category */
.admin-category-tag.wellness {
  background: #EBF0E7;
  color: #0D824B;
}

.admin-category-tag.learning,
.admin-category-tag.community-service,
.admin-category-tag.personal-development {
  background: #E7F8F0;
  color: #0D824B;
}

.admin-category-tag.productivity,
.admin-category-tag.career {
  background: #ECF2FD;
  color: #447AED;
}

.admin-template-type {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-heading);
  font-size: 14px;
  font-weight: 400;
}

.admin-template-type svg {
  flex-shrink: 0;
  color: var(--text-subtle);
  width: 16px;
  height: 16px;
}

.admin-template-frequency {
  color: var(--text-heading);
  font-size: 14px;
  font-weight: 400;
}

.admin-template-target {
  color: var(--text-heading);
  font-size: 14px;
  font-weight: 400;
}

.admin-status-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
}

.admin-status-tag.active {
  background: #E7F8F0;
  color: #0D824B;
}

.admin-status-tag.inactive {
  background: rgba(156, 163, 175, 0.15);
  color: var(--gray-500);
}

.admin-template-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 0;
  transition: all 0.2s;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
}

.admin-action-btn.admin-edit-btn {
  color: var(--text-subtle);
  border-color: #E8E8E8;
}

.admin-action-btn.admin-edit-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-100);
}

.admin-action-btn.admin-delete-btn {
  color: #DC2626;
  border-color: #FEE2E2;
  background: #FEE2E2;
}

.admin-action-btn.admin-delete-btn:hover {
  background: #FECACA;
  border-color: #FCA5A5;
}

@media (max-width: 1024px) {
  .admin-templates-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-templates-table-container,
  .admin-users-table-container {
    overflow: visible;
  }

  .admin-templates-table,
  .admin-users-table {
    min-width: 900px;
  }

  .admin-templates-table th,
  .admin-templates-table td,
  .admin-users-table th,
  .admin-users-table td {
    padding: 1rem 1rem;
    font-size: 14px;
    white-space: nowrap;
  }

  .admin-templates-table th:first-child,
  .admin-templates-table td:first-child,
  .admin-users-table th:first-child,
  .admin-users-table td:first-child {
    min-width: 200px;
  }

  .admin-templates-table th:nth-child(2),
  .admin-templates-table td:nth-child(2),
  .admin-users-table th:nth-child(2),
  .admin-users-table td:nth-child(2) {
    min-width: 150px;
  }

  /* Prevent action buttons from wrapping */
  .admin-user-actions {
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .admin-action-btn {
    flex-shrink: 0;
  }

  .admin-templates-table td:last-child,
  .admin-users-table td:last-child {
    white-space: nowrap;
    min-width: 100px;
  }
}

/* Admin Content Manager Page */
.admin-content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.admin-content-header-left {
  flex: 1;
}

.admin-content-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
}

.admin-content-subtitle {
  font-size: 14px;
  color: var(--text-subtle);
  margin: 0;
  font-weight: 400;
}

.admin-content-header-right {
  display: flex;
  align-items: center;
}

.admin-create-content-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 12px 24px;
  height: 48px;
  background: var(--secondary);
  color: var(--white);
  border-radius: 9999px;
  border: none;
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  transition: all 0.2s;
  cursor: pointer;
}

.admin-create-content-btn:hover {
  background: #0080D1;
  color: var(--white);
}

.admin-create-content-btn svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  stroke: var(--white);
}

.admin-content-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.admin-content-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--gray-100);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-content-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.admin-content-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-content-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.admin-content-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #ECF2FD;
  color: #447AED;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-content-icon-number {
  font-size: 16px;
  font-weight: 600;
  color: #447AED;
  line-height: 1;
}

.admin-content-icon-box svg {
  width: 20px;
  height: 20px;
}

.admin-content-icon-box svg path {
  fill: #447AED;
  stroke: #447AED;
}

.admin-content-icon-box svg path[fill] {
  fill: #447AED;
}

.admin-content-icon-box svg path[stroke] {
  stroke: #447AED;
  fill: none;
}

.admin-content-title-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.admin-content-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.admin-content-action-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid #F0F1F3;
  background: var(--white);
  padding: 0;
}

.admin-content-action-btn.admin-edit-btn {
  color: var(--text-heading);
  border: 1px solid #F0F1F3;
  background: var(--white);
}

.admin-content-action-btn.admin-edit-btn:hover {
  background: var(--gray-50);
}

.admin-content-action-btn.admin-delete-btn {
  color: #DA3E33;
  border: 1px solid #FEE2E2;
  background: transparent;
}

.admin-content-action-btn.admin-delete-btn:hover {
  opacity: 0.9;
}

.admin-content-action-btn.admin-delete-btn svg {
  display: block;
}

.admin-content-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
}

.admin-content-type-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  background: #ECF2FD;
  color: #447AED;
}

.admin-content-card-body {
  background: #F7FBFD;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.5rem;
}

.admin-content-preview {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-heading);
  line-height: 1.5;
  word-break: break-word;
  margin: 0;
}

.admin-content-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0;
  margin-top: 0;
}

.admin-content-date {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-subtle);
}

.admin-content-visibility-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-content-visibility-btn.visible {
  background: #E7F8F0;
  color: #0D824B;
}

.admin-content-visibility-btn.visible svg {
  stroke: #0D824B;
}

.admin-content-visibility-btn.hidden {
  background: rgba(156, 163, 175, 0.15);
  color: var(--gray-500);
}

.admin-content-visibility-btn svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

@media (max-width: 1024px) {
  .admin-content-grid {
    grid-template-columns: 1fr;
  }
}

.admin-alert-container {
  width: 100%;
  padding: 1rem 0 0;
  margin: 0;
}

.sidebar-toggle {
  display: none !important;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }

  .admin-sidebar.active {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: none !important;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .admin-content {
    padding: 1rem 1rem 20px 1rem;
  }

  .admin-alert-container {
    padding: 1rem 1rem 0;
  }
}

@media (max-width: 768px) {
  .navbar-content {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 1.5rem;
  }
}

/* Admin Users Management Page */
.admin-users-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.admin-users-header-left {
  flex: 1;
}

.admin-users-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
}

.admin-users-subtitle {
  font-size: 14px;
  color: var(--text-subtle);
  margin: 0;
  font-weight: 400;
}

.admin-users-search-form {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  align-items: center;
}

.admin-users-table-container {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--gray-100);
  padding: 1.25rem;
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-users-table thead {
  background: var(--white);
}

.admin-users-table th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: none;
  background: var(--white);
}

.admin-users-table tr {
  border-bottom: 1px solid #F0F1F3;
  transition: background 0.2s;
}

.admin-users-table tbody tr:hover {
  background: var(--gray-50);
}

.admin-users-table tbody tr:last-child {
  border-bottom: none;
}

.admin-users-table td {
  padding: 1rem 1.25rem;
  font-size: 14px;
  color: var(--text-heading);
  vertical-align: middle;
}

.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-avatar-initial {
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

.admin-user-info {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.admin-user-name {
  font-weight: 600;
  color: var(--text-heading);
  font-size: 14px;
}

.admin-user-email {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.admin-active-goals-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  background: #E7F8F0;
  color: #0D824B;
}

.admin-inactive-goals-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(156, 163, 175, 0.15);
  color: var(--gray-500);
}

.admin-completion-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(34, 197, 94, 0.2);
  border-radius: 4px;
  overflow: hidden;
  min-width: 40px;
}

.admin-progress-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 4px;
  transition: width 0.3s;
}

.admin-completion-percentage {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-heading);
  text-align: right;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-action-btn.admin-view-btn {
  color: var(--gray-700);
}

.admin-action-btn.admin-view-btn:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.admin-empty-state {
  background: var(--white);
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.admin-empty-state p {
  color: var(--gray-500);
  font-size: 1rem;
  margin: 0;
}

/* ============================================
   COMPREHENSIVE RESPONSIVE STYLES
   ============================================ */

/* Tablet and below (max-width: 1024px) */
@media (max-width: 1024px) {

  /* Sidebar adjustments */
  .admin-sidebar {
    width: 240px;
  }

  .admin-main {
    margin-left: 240px;
    width: calc(100% - 240px);
  }

  /* Page header */
  .admin-page-header {
    padding: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .admin-header-right {
    flex-wrap: wrap;
  }

  /* Dashboard stats grid */
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  /* Templates header */
  .admin-templates-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .admin-templates-header-right {
    width: 100%;
  }

  .admin-create-template-btn {
    width: 100%;
    justify-content: center;
  }

  /* Tables - horizontal scroll */
  .admin-templates-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-templates-table {
    min-width: 800px;
  }

  /* Content grid */
  .admin-content-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  /* Categories grid */
  .admin-categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* User info grid */
  .admin-user-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Goals grid */
  .admin-goals-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Modals */
  .admin-modal-content {
    max-width: 90%;
    margin: 1rem;
  }

  .admin-category-modal-content {
    max-width: 90%;
  }

  /* Filters */
  .admin-templates-filters {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .admin-search-input {
    flex: 1;
    min-width: 200px;
  }

  .admin-filter-btn {
    min-width: 150px;
  }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {

  /* Sidebar - hidden by default */
  .admin-sidebar {
    transform: translateX(-100%);
    width: 280px;
    position: fixed;
    z-index: 1000;
    height: 100vh;
    left: 0;
    top: 0;
    border-radius: 0;
  }

  .admin-sidebar.active {
    transform: translateX(0);
  }

  /* Logo menu icon on mobile - always visible outside sidebar */
  .logo-menu-icon-mobile {
    position: fixed !important;
    top: 1rem !important;
    right: 1rem !important;
    left: auto !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: #F5FAFD !important;
    border: 1px solid var(--gray-100) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    width: 40px !important;
    height: 40px !important;
    z-index: 1001 !important;
    opacity: 1 !important;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .logo-menu-icon-mobile:hover,
  .logo-menu-icon-mobile:active {
    background: #F5FAFD !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  }

  .logo-menu-icon-mobile svg {
    width: 20px;
    height: 20px;
    display: block;
    transition: transform 0.3s ease;
  }

  .logo-menu-icon-mobile svg path {
    stroke: #03101A;
    transition: all 0.3s ease;
  }

  /* Hamburger to X animation - handled by JavaScript */
  .logo-menu-icon-mobile.active svg path {
    transition: d 0.3s ease;
  }

  /* Logo menu icon inside sidebar on mobile - hide it */
  .logo-menu-icon {
    display: none !important;
  }

  .admin-sidebar.collapsed {
    width: 280px;
    padding: 30px;
    transform: translateX(-100%);
  }

  .admin-sidebar.collapsed.active {
    transform: translateX(0);
  }

  .admin-sidebar.collapsed .logo-menu-icon,
  .admin-sidebar.collapsed .sidebar-collapse-btn {
    position: static !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    margin: 0 auto !important;
    background: var(--white) !important;
    border: 1px solid var(--gray-100) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  }

  .admin-sidebar.collapsed .logo-menu-icon .expand-arrow {
    transform: rotate(180deg);
  }

  .admin-sidebar.collapsed .sidebar-logo-image {
    display: block;
  }

  .admin-sidebar.collapsed .sidebar-text {
    display: block;
  }

  .admin-sidebar.collapsed .sidebar-link {
    justify-content: flex-start;
    padding: 14px;
  }

  .admin-main {
    margin-left: 0;
    width: 100%;
  }

  .admin-sidebar.collapsed~.admin-main {
    margin-left: 0;
    width: 100%;
  }

  .sidebar-toggle {
    display: none !important;
  }

  .sidebar-overlay.active {
    display: block;
  }

  /* Content padding */
  .admin-content {
    padding: 1rem 1rem 20px 1rem;
  }

  .admin-alert-container {
    padding: 1rem 1rem 0;
  }

  /* Page header */
  .admin-page-header {
    padding: 0.75rem 1rem 0.75rem 4rem;
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
  }

  .admin-header-title {
    font-size: 0.875rem;
  }

  .admin-header-right {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Dashboard stats - single column */
  .admin-stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .admin-stat-card {
    padding: 1rem;
  }

  .admin-stat-title {
    font-size: 14px;
  }

  .admin-stat-value {
    font-size: 20px;
  }

  /* Templates header */
  .admin-templates-header {
    margin-bottom: 1.5rem;
  }

  .admin-templates-title {
    font-size: 18px;
  }

  .admin-templates-subtitle {
    font-size: 13px;
  }

  /* Tables - full width scroll */
  .admin-templates-table-container,
  .admin-users-table-container {
    padding: 1rem;
    border-radius: 8px;
    overflow: visible;
  }

  .admin-templates-table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
  }

  .admin-templates-filters {
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 1rem;
  }

  .admin-search-input {
    width: 100%;
    min-width: 100%;
  }

  .admin-filter-btn {
    width: 100%;
    min-width: 100%;
    justify-content: space-between;
  }

  .admin-templates-table,
  .admin-users-table {
    min-width: 850px;
    font-size: 14px;
  }

  .admin-templates-table th,
  .admin-templates-table td,
  .admin-users-table th,
  .admin-users-table td {
    padding: 0.875rem 1rem;
    font-size: 13px;
    white-space: nowrap;
  }

  .admin-templates-table th:first-child,
  .admin-templates-table td:first-child,
  .admin-users-table th:first-child,
  .admin-users-table td:first-child {
    min-width: 180px;
  }

  .admin-templates-table th:nth-child(2),
  .admin-templates-table td:nth-child(2),
  .admin-users-table th:nth-child(2),
  .admin-users-table td:nth-child(2) {
    min-width: 140px;
  }

  .admin-template-name,
  .admin-template-description {
    white-space: normal;
    word-break: break-word;
  }

  .admin-template-name-cell {
    min-width: 200px;
  }

  .admin-user-cell {
    min-width: 180px;
  }

  /* Content grid - single column */
  .admin-content-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .admin-content-card {
    padding: 1rem;
  }

  .admin-content-card-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .admin-content-title-row {
    flex: 1;
    min-width: 0;
  }

  .admin-content-actions {
    flex-shrink: 0;
  }

  /* Categories grid - single column */
  .admin-categories-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .admin-category-card {
    padding: 1rem;
  }

  .admin-add-category-btn {
    width: 100%;
    min-width: 100%;
  }

  /* User management */
  .admin-users-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .admin-users-title {
    font-size: 18px;
  }

  .admin-users-subtitle {
    font-size: 13px;
  }

  .admin-stat-card {
    padding: 1rem;
  }

  /* User info grid - single column */
  .admin-user-info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .admin-goals-grid {
    grid-template-columns: 1fr;
  }

  /* Weekly summaries */
  .admin-weekly-summary-item {
    padding: 0.75rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .admin-weekly-summary-percentage {
    padding-left: 0;
    min-width: auto;
    text-align: left;
    width: 100%;
  }

  /* Modals - full width on mobile */
  .admin-modal {
    padding: 0.5rem;
  }

  .admin-modal-content {
    max-width: 100%;
    margin: 0;
    border-radius: 12px;
    max-height: 95vh;
    overflow-y: auto;
  }

  .admin-category-modal-content {
    max-width: 100%;
  }

  .admin-modal-header {
    padding: 1rem;
  }

  .admin-modal-title {
    font-size: 18px;
  }

  .admin-modal-form {
    padding: 1rem;
  }

  .admin-modal-footer {
    flex-direction: column-reverse;
    gap: 0.75rem;
    padding: 0 1rem 1.5rem 1rem;
  }

  .admin-modal-btn {
    width: 100%;
    justify-content: center;
  }

  /* Icon grid */
  .admin-icon-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }

  .admin-icon-option {
    min-height: 48px;
  }

  /* Forms */
  .admin-form-group {
    margin-bottom: 1rem;
  }

  .admin-form-label {
    font-size: 14px;
    margin-bottom: 0.5rem;
  }

  .admin-form-input {
    font-size: 14px;
    padding: 0.625rem 0.75rem;
  }

  /* Action buttons - larger touch targets */
  .admin-user-actions {
    flex-wrap: nowrap;
    gap: 0.5rem;
    white-space: nowrap;
  }

  .admin-action-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    flex-shrink: 0;
  }

  .admin-action-btn svg {
    width: 40px;
    height: 40px;
  }

  /* Ensure action column doesn't shrink */
  .admin-templates-table td:last-child,
  .admin-users-table td:last-child {
    white-space: nowrap;
    min-width: 100px;
  }

  .admin-content-action-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .admin-category-action-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  /* Filter dropdown */
  .admin-filter-dropdown {
    width: 100%;
    left: 0;
    right: 0;
  }

  /* Dashboard cards */
  .admin-dashboard-card {
    padding: 1rem;
  }

  .admin-card-header {
    padding-bottom: 1rem;
  }

  .admin-card-title {
    font-size: 16px;
  }

  /* Popular templates and reflections */
  .admin-template-item,
  .admin-reflection-item {
    padding: 0.75rem 0;
  }

  .admin-rank-badge {
    width: 40px;
    height: 36px;
    font-size: 14px;
  }

  /* Content card body */
  .admin-content-card-body {
    padding: 0.75rem;
  }

  /* Empty state */
  .admin-empty-state {
    padding: 2rem 1rem;
  }

  /* Prevent action buttons from wrapping */
  .admin-user-actions {
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .admin-action-btn {
    flex-shrink: 0;
  }

  .admin-templates-table td:last-child,
  .admin-users-table td:last-child {
    white-space: nowrap;
    min-width: 100px;
  }
}

/* Small mobile (max-width: 480px) */
@media (max-width: 480px) {
  .admin-content {
    padding: 0.75rem 0.75rem 20px 0.75rem;
  }

  .admin-page-header {
    padding: 0.75rem 0.75rem 0.75rem 4rem;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
  }


  .admin-stat-card {
    padding: 0.75rem;
  }

  .admin-templates-table-container,
  .admin-users-table-container {
    padding: 0.75rem;
    overflow: visible;
  }

  .admin-templates-table-wrapper {
    margin-top: 0.75rem;
  }

  .admin-templates-table,
  .admin-users-table {
    min-width: 800px;
    font-size: 13px;
  }

  .admin-templates-table th,
  .admin-templates-table td,
  .admin-users-table th,
  .admin-users-table td {
    padding: 0.75rem 0.875rem;
    font-size: 12px;
    white-space: nowrap;
  }

  .admin-templates-table th:first-child,
  .admin-templates-table td:first-child,
  .admin-users-table th:first-child,
  .admin-users-table td:first-child {
    min-width: 160px;
  }

  .admin-templates-table th:nth-child(2),
  .admin-templates-table td:nth-child(2),
  .admin-users-table th:nth-child(2),
  .admin-users-table td:nth-child(2) {
    min-width: 120px;
  }

  .admin-template-name,
  .admin-template-description {
    white-space: normal;
    word-break: break-word;
  }

  .admin-template-name-cell {
    min-width: 180px;
  }

  .admin-user-cell {
    min-width: 160px;
  }

  .admin-content-card {
    padding: 0.75rem;
  }

  .admin-category-card {
    padding: 0.75rem;
  }

  .admin-modal-form {
    padding: 0.75rem;
  }

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

  .admin-templates-title {
    font-size: 16px;
  }

  .admin-users-title {
    font-size: 16px;
  }

  .admin-card-title {
    font-size: 14px;
  }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
  .admin-modal-content {
    max-height: 90vh;
  }

  .admin-sidebar {
    width: 240px;
  }
}

/* Print styles */
@media print {

  .admin-sidebar,
  .admin-page-header,
  .admin-header-right,
  .admin-action-btn,
  .admin-modal,
  .admin-create-template-btn,
  .admin-add-category-btn {
    display: none !important;
  }

  .admin-main {
    margin-left: 0;
    width: 100%;
  }

  .admin-content {
    padding: 0 0 20px 0;
  }
}

/* ============================================
   USER PORTAL STYLES
   ============================================ */

body.user-body {
  min-height: 0;
  height: 100vh;
  overflow: hidden;
}

.user-body {
  --user-navbar-height: 70px;
  --user-sidebar-width: 240px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--gray-50);
}

/* User Sidebar — fixed, full height, no internal scroll */
.user-sidebar {
  width: var(--user-sidebar-width);
  background: var(--white);
  border-right: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: var(--user-navbar-height);
  height: calc(100vh - var(--user-navbar-height));
  z-index: 900;
  overflow: hidden;
  padding-left: 2rem;
  padding-right: 2rem;
  box-sizing: border-box;
}

.user-sidebar-add-goal {
  padding: 1.25rem 0 0.75rem;
  flex-shrink: 0;
}

.user-add-goal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 1rem;
  background: var(--white);
  color: var(--text-heading);
  border: 1px solid var(--gray-100);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.user-add-goal-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.user-sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0.75rem 0;
  overflow: hidden;
}

.user-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem 0.625rem 1.25rem;
  margin: 0;
  flex-shrink: 0;
  color: var(--gray-700);
  text-decoration: none;
  border-radius: var(--radius);
  transition: var(--transition-fast);
  font-size: 0.875rem;
  font-weight: 500;
  position: relative;
}

.user-sidebar-link:hover {
  background: var(--gray-100);
  color: var(--secondary);
}

.user-sidebar-link:hover .user-sidebar-icon,
.user-sidebar-link:hover .user-sidebar-icon svg {
  color: inherit;
}

.user-sidebar-link:hover .user-sidebar-icon svg path {
  stroke: currentColor;
}

.user-sidebar-link.active {
  background: var(--accent-subtle);
  color: var(--secondary);
}

.user-sidebar-link.active .user-sidebar-icon,
.user-sidebar-link.active .user-sidebar-icon svg {
  color: inherit;
}

.user-sidebar-link.active .user-sidebar-icon svg path {
  stroke: currentColor;
}

.user-sidebar-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
}

.user-sidebar-text {
  flex: 1;
}

.user-sidebar-footer {
  margin-top: auto;
  padding: 1rem 0 1.5rem;
  flex-shrink: 0;
}

/* User Navbar */
.user-navbar {
  width: 100%;
  height: var(--user-navbar-height, 70px);
  background: var(--white);
  border: 1px solid var(--gray-100);
  z-index: 1000;
  position: relative;
  flex-shrink: 0;
}

.user-navbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 2rem;
  max-width: 100%;
}

.user-navbar-left {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--gray-700);
}

.user-sidebar-toggle:hover {
  background: var(--gray-100);
  color: var(--text-heading);
}

.user-navbar-logo {
  display: block;
  height: 38px;
  width: auto;
  color: var(--text-heading);
  flex-shrink: 0;
}

.user-navbar-logo-icon {
  flex-shrink: 0;
}

.user-navbar-logo-text {
  font-size: 1.125rem;
  color: var(--text-heading);
}

.user-logo-bold {
  font-weight: 700;
}

.user-logo-regular {
  font-weight: 400;
}

.user-navbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto;
}

.user-search-bar {
  position: relative;
  width: 100%;
  max-width: 350px;
}

.user-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
}

.user-search-icon svg {
  width: 20px;
  height: 20px;
}

.user-search-icon {
  color: var(--neutral-500);
}

.user-search-input {
  width: 100%;
  padding: 0.625rem 1rem 0.625rem 2.75rem;
  border: 1px solid var(--gray-100);
  border-radius: 9999px;
  font-size: 0.875rem;
  background: var(--white);
  color: var(--gray-900);
  transition: all 0.2s;
  height: 40px;
}

.user-search-input:focus {
  outline: none;
  border-color: var(--secondary);
  background: var(--white);
  box-shadow: 0 0 0 3px hsla(var(--secondary-base), 0.12);
}

.user-search-input::placeholder {
  color: var(--gray-500);
}

.user-navbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.user-notification-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--gray-700);
}

.user-notification-btn:hover {
  background: var(--gray-100);
  color: var(--text-heading);
}

.user-profile-dropdown {
  position: relative;
}

.user-profile-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.user-profile-trigger:hover {
  background: var(--gray-100);
}

.user-profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-profile-initial {
  color: var(--text-on-accent);
  font-size: 0.875rem;
  font-weight: 600;
}

.user-profile-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-900);
}

.user-profile-arrow {
  transition: transform 0.2s;
  flex-shrink: 0;
  color: var(--text-label);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 180px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
  z-index: 1000;
}

.user-dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s;
  border-bottom: 1px solid var(--gray-100);
}

.user-dropdown-item:last-child {
  border-bottom: none;
}

.user-dropdown-item:hover {
  background: var(--gray-50);
  color: var(--text-heading);
}

.user-dropdown-item-danger {
  color: var(--danger);
}

.user-dropdown-item-danger:hover {
  background: #FEE2E2;
  color: var(--danger);
}

/* User Container: Sidebar + Content */
.user-container {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

/* User Main Content — scrolls independently of fixed sidebar */
.user-main {
  flex: 1;
  min-height: 0;
  margin-left: var(--user-sidebar-width, 240px);
  width: calc(100% - var(--user-sidebar-width, 240px));
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--surface-page);
}

.user-content {
  padding: 2rem;
  width: 100%;
  background: var(--surface-page);
}

.user-content:has(.user-dashboard-page) {
  background: var(--surface-page);
}

.user-alert-container {
  margin-bottom: 1.5rem;
}

/* Sidebar Overlay for Mobile */
.user-sidebar-overlay {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.user-sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Responsive Styles for User Portal */
@media (max-width: 1024px) {
  .user-sidebar-toggle {
    display: flex;
  }

  .user-container {
    position: relative;
  }

  .user-sidebar {
    top: 64px;
    height: calc(100vh - 64px);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
  }

  .user-sidebar.active {
    transform: translateX(0);
  }

  .user-main {
    margin-left: 0;
    width: 100%;
  }

  .user-navbar-center {
    max-width: 400px;
  }
}

@media (max-width: 768px) {
  .user-navbar-content {
    padding: 0 1rem;
  }

  .user-navbar-logo-text {
    display: none;
  }

  .user-navbar-center {
    max-width: 300px;
  }

  .user-profile-name {
    display: none;
  }

  .user-content {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 480px) {
  .user-navbar-center {
    max-width: 200px;
  }

  .user-search-input {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  }

  .user-content {
    padding: 1rem 0.75rem;
  }
}

/* ============================================
   USER DASHBOARD STYLES
   ============================================ */

.user-dashboard-page {
  --dash-gap: 0.625rem;
  --dash-pad: 1rem;
  display: flex;
  flex-direction: column;
  gap: var(--dash-gap);
  width: 100%;
}

/* Dashboard Header */
.user-dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.user-dashboard-greeting {
  flex: 1;
}

.user-dashboard-title {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.user-dashboard-date {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin: 0.35rem 0 0;
}

.user-dashboard-filter {
  flex-shrink: 0;
}

.user-dashboard-select {
  padding: 0.625rem 1rem;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-900);
  font-size: 0.875rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%23374151' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.user-dashboard-select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(0, 148, 233, 0.1);
}

/* Stats Banner / Overview Row */
.dashboard-stats-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.dashboard-stat-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 1px 2px rgba(3, 16, 26, 0.02), 0 4px 12px rgba(3, 16, 26, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(3, 16, 26, 0.04), 0 10px 20px rgba(3, 16, 26, 0.04);
}

.dashboard-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dashboard-stat-icon--goals {
  background: #EEF2FF;
  color: #4F46E5;
}

.dashboard-stat-icon--checkins {
  background: #ECFDF5;
  color: #10B981;
}

.dashboard-stat-icon--streaks {
  background: #FFF7ED;
  color: #F59E0B;
}

.dashboard-stat-icon--points {
  background: #F0F9FF;
  color: #0EA5E9;
}

.dashboard-stat-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.dashboard-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading);
}

.dashboard-stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-500);
  margin-top: 0.15rem;
}

/* Dashboard layout — two balanced columns */
.user-dashboard-layout {
  display: flex;
  flex-direction: column;
  gap: var(--dash-gap, 0.75rem);
}

.user-dashboard-layout__columns {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 380px);
  gap: var(--dash-gap, 0.75rem);
  align-items: start;
}

.user-dashboard-layout__paired {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 380px);
  gap: var(--dash-gap, 0.75rem);
  align-items: stretch;
}

.user-dashboard-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--dash-gap);
  align-content: start;
  min-width: 0;
}

.user-dashboard-column > .quick-log,
.user-dashboard-column > .user-dashboard-card,
.user-dashboard-column > .coaching-preview-card,
.user-dashboard-column > .missions-card,
.user-dashboard-layout__paired > .missions-card,
.user-dashboard-layout__paired > .leaderboard-card--preview {
  width: 100%;
  min-width: 0;
}

.user-dashboard-page .user-dashboard-card-header {
  margin-bottom: var(--dash-gap);
}

.user-dashboard-page .user-dashboard-card-body {
  gap: var(--dash-gap);
}

/* Legacy grid aliases */
.user-dashboard-grid,
.user-dashboard-main-layout {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.user-dashboard-left-column,
.user-dashboard-right-column {
  display: contents;
}

.user-dashboard-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0;
}

/* Dashboard Card */
.user-dashboard-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  padding: var(--dash-pad, 1rem);
  box-shadow: 0 1px 2px rgba(3, 16, 26, 0.04), 0 4px 16px rgba(3, 16, 26, 0.03);
}

.user-dashboard-card--compact {
  padding: var(--dash-pad, 1rem);
}

.user-dashboard-card--compact .user-dashboard-empty {
  padding: 0.15rem 0;
}

.user-dashboard-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--dash-gap, 0.75rem);
  margin-bottom: var(--dash-gap, 0.75rem);
}

.user-dashboard-card-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem 0.75rem;
  flex-shrink: 0;
}

.user-dashboard-card-header-actions .leaderboard-reset {
  margin: 0;
  padding: 0;
  font-size: 0.75rem;
  color: var(--gray-400);
  white-space: nowrap;
}

.user-dashboard-card-title-wrapper {
  display: flex;
  align-items: center;
  gap: var(--dash-gap, 0.75rem);
}

.user-dashboard-card-icon {
  color: var(--gray-700);
  flex-shrink: 0;
}

.user-dashboard-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
  letter-spacing: -0.01em;
}

.user-dashboard-card-link {
  font-size: 0.8125rem;
  color: var(--secondary);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.user-dashboard-card-link:hover {
  color: #0080c7;
}

.user-dashboard-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--dash-gap, 0.75rem);
}

.user-dashboard-card-body--flush {
  gap: var(--dash-gap, 0.75rem);
  padding-top: 0;
}

/* Task Items */
.user-dashboard-task-item {
  display: flex;
  align-items: center;
  gap: var(--dash-gap, 0.75rem);
  padding: var(--dash-gap, 0.75rem);
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  margin-bottom: 0;
  transition: all 0.2s ease;
}

.user-dashboard-task-item:hover {
  border-color: #D1D5DB;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.user-dashboard-task-item:last-child {
  margin-bottom: 0;
}

.user-dashboard-task-checkbox {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-task-check-form {
  display: inline-block;
  margin: 0;
  padding: 0;
}

.user-task-checkbox-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.user-task-checkbox-btn:hover:not(:disabled) {
  transform: scale(1.1);
}

.user-task-checkbox-btn svg circle {
  transition: stroke 0.15s ease, fill 0.15s ease;
}

.user-task-checkbox-btn:hover svg circle {
  stroke: var(--secondary);
}

.user-dashboard-task-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.user-dashboard-task-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dashboard-task-name--completed {
  text-decoration: line-through;
  color: var(--gray-400);
}

.user-dashboard-task-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 500;
}

.user-dashboard-task-category-tag {
  flex-shrink: 0;
}

.user-task-checked {
  flex-shrink: 0;
}

/* Responsiveness overrides */
@media (max-width: 1024px) {
  .dashboard-stats-banner {
    grid-template-columns: repeat(2, 1fr);
  }
  .user-dashboard-layout__columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dashboard-stats-banner {
    grid-template-columns: 1fr;
  }
}

.user-dashboard-empty {
  color: var(--gray-500);
  font-size: 0.875rem;
  margin: 0;
}

/* Reflection Card */
.user-dashboard-reflection-box {
  background: linear-gradient(135deg, #e8f4fd 0%, #f0f9ff 100%);
  border-radius: 10px;
  padding: var(--dash-gap, 0.75rem);
  border: 1px solid rgba(0, 148, 233, 0.12);
}

.user-dashboard-reflection-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--dash-gap, 0.75rem);
}

.user-dashboard-reflection-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-heading);
  font-size: 0.875rem;
  font-weight: 500;
}

.user-dashboard-reflection-date svg {
  color: #447AED;
  flex-shrink: 0;
}

.user-dashboard-reflection-view-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #447AED;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: color 0.2s;
}

.user-dashboard-reflection-view-link:hover {
  color: #0069A5;
}

.user-dashboard-reflection-view-link svg {
  flex-shrink: 0;
}

.user-dashboard-reflection-text {
  font-size: 16px;
  color: var(--text-heading);
  line-height: 1.6;
  margin: 0;
  font-weight: 600;
}

/* Section Headers */
.user-dashboard-section {
  margin-bottom: 2rem;
}

.user-dashboard-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.user-dashboard-section-icon {
  color: var(--gray-700);
  flex-shrink: 0;
}

.user-dashboard-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
}

/* Goals Grid */
.user-dashboard-goals-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: var(--dash-gap, 0.75rem);
  align-items: start;
}

.user-dashboard-goal-card {
  background: #F7FBFD;
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  position: relative;
  min-height: 0;
}

.user-dashboard-goal-card.wellness {
  background: #F0F9F4;
}

.user-dashboard-goal-card.productivity {
  background: #F7FBFD;
}

.user-dashboard-goal-progress {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  align-self: flex-start;
}

.user-goal-progress-circle {
  width: 100%;
  height: 100%;
}

.user-goal-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 100%;
  z-index: 1;
  pointer-events: none;
}

.user-goal-progress-count {
  font-size: 1rem;
  font-weight: 700;
  color: #2E6B2E;
  line-height: 1;
}

.user-dashboard-goal-card.wellness .user-goal-progress-count {
  color: #2E6B2E;
}

.user-dashboard-goal-card.productivity .user-goal-progress-count {
  color: #447AED;
}

.user-dashboard-goal-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  align-self: flex-start;
}

.user-dashboard-goal-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0;
}

.user-dashboard-goal-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  width: fit-content;
}

.user-dashboard-goal-card.wellness .user-dashboard-goal-category.wellness {
  background: #E7F8F0;
  color: #2E6B2E;
  border: none;
}

.user-dashboard-goal-card.productivity .user-dashboard-goal-category.productivity {
  background: #D6E5FC;
  color: #447AED;
}

/* Default category tag colors for non-wellness/productivity cards */
.user-dashboard-goal-card:not(.wellness):not(.productivity) .user-dashboard-goal-category {
  background: #F3F4F6;
  color: #6B7280;
}

.user-dashboard-goal-category.learning,
.user-dashboard-goal-category.personal-development,
.user-dashboard-goal-category.community-service {
  background: #FEF3C7;
  color: #D97706;
}

.user-dashboard-goal-actions {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  z-index: 10;
}

.user-dashboard-goal-view-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: var(--gray-700);
}

.user-dashboard-goal-view-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  color: var(--text-heading);
}

.user-dashboard-goal-add-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.user-dashboard-goal-add-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.user-dashboard-goal-add-btn:hover:not(:disabled) {
  background: var(--gray-50);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.user-dashboard-goal-add-btn:disabled,
.user-task-checkbox-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Upcoming Deadlines List Style */
.user-upcoming-deadlines-list {
  background: var(--white);
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-upcoming-deadlines-items-wrapper {
  background: #f9fafb;
  border: 1px solid var(--gray-100);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  overflow: hidden;
}

.user-upcoming-deadlines-list .user-dashboard-card-header {
  border-bottom: none;
}

.user-upcoming-deadlines-list .user-dashboard-card-title {
  color: var(--text-heading);
  font-weight: 500;
}

.user-upcoming-deadlines-list .user-dashboard-card-icon {
  color: #6B7280;
}

.user-upcoming-deadline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s;
}

.user-upcoming-deadline-item:hover {
  background-color: transparent;
}

.user-upcoming-deadline-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.user-upcoming-deadline-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-label);
  margin: 0;
}

.user-upcoming-deadline-date-tag {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 700;
  background: #FFFBF0;
  color: #EA580C;
  width: fit-content;
  border: 1px solid rgba(255, 152, 0, 0.15);
}

.user-upcoming-deadline-arrow {
  flex-shrink: 0;
  color: #6B7280;
}

.user-upcoming-deadline-divider {
  height: 1px;
  background-color: var(--gray-100);
  margin: 0;
}

/* Deadlines Grid */
.user-dashboard-deadlines-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.user-dashboard-deadline-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.75rem;
  border: 1px solid var(--gray-100);
  position: relative;
}

.user-dashboard-column--side .user-dashboard-sessions-grid {
  display: flex;
  flex-direction: column;
  gap: var(--dash-gap, 0.75rem);
}

.user-dashboard-column--side .user-dashboard-deadline-card {
  padding: var(--dash-gap, 0.75rem);
  gap: var(--dash-gap, 0.75rem);
  border-radius: 10px;
  background: #f9fafb;
}

.user-dashboard-column--side .user-deadline-card-icon {
  width: 36px;
  height: 36px;
}

.user-dashboard-column--side .user-deadline-card-name {
  font-size: 0.875rem;
}

.user-deadline-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #DBEAFE;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #447AED;
  flex-shrink: 0;
  align-self: flex-start;
}

.user-deadline-card-icon svg {
  width: 24px;
  height: 24px;
}

.user-deadline-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0;
  align-self: flex-start;
  line-height: 1.4;
}

.user-deadline-date-tag {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 700;
  background: #FFFBF0;

  color: #EA580C;
  width: fit-content;
  line-height: 1.2;
  border: 1px solid rgba(255, 152, 0, 0.15);
}

.user-deadline-date-tag.session-tag {
  background: #E0F2FE;

  color: #447AED;
  border: 1px solid rgba(66, 122, 237, 0.2);
  align-self: flex-start;
}

.user-deadline-date-tag.session-tag.orange-tag {
  background: #FFFBF0;

  color: #EA580C;
  border: 1px solid rgba(255, 152, 0, 0.15);
  align-self: flex-start;
}

.user-deadline-date-tag.session-tag.blue-tag {
  background: #E0F2FE;

  color: #447AED;
  border: 1px solid rgba(66, 122, 237, 0.2);
  align-self: flex-start;
}

.user-dashboard-deadlines-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.user-deadline-icon {
  color: var(--secondary);
  flex-shrink: 0;
}

.user-deadline-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.user-deadline-date {
  font-size: 0.75rem;
  color: #F59E0B;
  font-weight: 500;
}

.user-deadline-arrow {
  color: var(--gray-400);
  flex-shrink: 0;
}

/* Missions empty — compact strip on dashboard */
.user-dashboard-column--side .missions-card--empty,
.missions-card--empty.missions-card {
  padding: 0.75rem 1rem;
}

.user-dashboard-column--side .missions-card--empty .user-dashboard-card-body,
.missions-card--empty .user-dashboard-card-body {
  padding-top: 0;
  gap: 0;
  min-height: 0;
}

.user-dashboard-column--side .missions-empty-state,
.missions-card--empty .missions-empty-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  background: var(--surface-sunken);
  border: 1px dashed var(--border-default);
  border-radius: 10px;
  text-align: left;
}

.user-dashboard-column--side .missions-empty-state__text,
.missions-card--empty .missions-empty-state__text {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-subtle);
  line-height: 1.35;
}

.missions-card--empty .user-dashboard-card-header {
  margin-bottom: 0.4rem;
}

/* Leaderboard in sidebar column */
.user-dashboard-layout__paired .leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: calc(var(--dash-gap) * 0.5);
}

.user-dashboard-layout__paired .leaderboard-row {
  padding: calc(var(--dash-gap) * 0.5) var(--dash-gap);
  border-radius: 8px;
}

.user-dashboard-layout__paired .leaderboard-row--you {
  margin: 0;
  padding: calc(var(--dash-gap) * 0.5) var(--dash-gap);
}

.user-dashboard-layout__paired .leaderboard-your-rank {
  margin-top: var(--dash-gap);
  padding: var(--dash-gap);
}

/* Missions + leaderboard: paired row, same height, scroll overflow */
.user-dashboard-layout__paired > .missions-card,
.user-dashboard-layout__paired > .leaderboard-card--preview {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 300px;
  max-height: 300px;
  height: 100%;
}

.user-dashboard-layout__paired > .missions-card .user-dashboard-card-header,
.user-dashboard-layout__paired > .leaderboard-card--preview .user-dashboard-card-header {
  flex-shrink: 0;
}

.user-dashboard-layout__paired > .missions-card .user-dashboard-card-body,
.user-dashboard-layout__paired > .leaderboard-card--preview .user-dashboard-card-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Responsive Dashboard */
@media (max-width: 1024px) {
  .user-dashboard-layout__columns,
  .user-dashboard-layout__paired {
    grid-template-columns: 1fr;
  }

  .user-dashboard-layout__paired > .missions-card,
  .user-dashboard-layout__paired > .leaderboard-card--preview {
    min-height: 280px;
    max-height: 280px;
  }

  .user-dashboard-column--side .missions-empty-state,
  .missions-card--empty .missions-empty-state {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-dashboard-top-grid {
    grid-template-columns: 1fr;
  }

  .user-dashboard-goals-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    flex: none;
  }

  .user-dashboard-deadlines-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .user-dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .user-dashboard-title {
    font-size: 1.5rem;
  }

  .user-dashboard-card {
    padding: 1.25rem;
  }
}

/* Goal Modal Styles */
.goal-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.goal-modal-content {
  background: #FFFFFF;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.goal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.goal-modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
}

.goal-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6B7280;
  transition: color 0.2s;
}

.goal-modal-close:hover {
  color: var(--text-label);
}

.goal-modal-body {
  padding: 1.5rem;
}

.goal-modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.goal-modal-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.goal-modal-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-label);
}

.goal-modal-currency-input {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  overflow: hidden;
  background: #FFFFFF;
}

.goal-modal-currency-symbol {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: #6B7280;
  background: #F9FAFB;
  border-right: 1px solid var(--gray-100);
}

.goal-modal-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  outline: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-heading);
  background: #FFFFFF;
}

.goal-modal-arrows {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--gray-100);
}

.goal-modal-arrow-btn {
  background: #F9FAFB;
  border: none;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  color: #6B7280;
  transition: background-color 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.goal-modal-arrow-btn:hover {
  background: #E5E7EB;
  color: var(--text-label);
}

.goal-modal-arrow-btn:first-child {
  border-bottom: 1px solid #D1D5DB;
}

.goal-modal-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.goal-modal-textarea:focus {
  border-color: #447AED;
}

.goal-modal-buttons {
  display: flex;
  gap: 0.75rem;
}

.goal-modal-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  background: #FFFFFF;
  color: var(--text-label);
}

.goal-modal-btn-yes {
  border-color: #22C55E;
  color: #22C55E;
}

.goal-modal-btn-yes:hover,
.goal-modal-btn-yes.active {
  background: #22C55E;
  color: #FFFFFF;
}

.goal-modal-btn-no {
  border-color: #EF4444;
  color: #EF4444;
}

.goal-modal-btn-no:hover,
.goal-modal-btn-no.active {
  background: #EF4444;
  color: #FFFFFF;
}

.goal-modal-actions {
  margin-top: 0.5rem;
}

.goal-modal-submit-btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: #447AED;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.goal-modal-submit-btn:hover {
  background: #3563D9;
}

.goal-modal-submit-btn:active {
  background: #2E56C7;
}

/* Goals Page Styles */
.goals-page-header {
  margin-bottom: 2rem;
}

.goals-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.goals-page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-add-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--secondary);
  color: var(--text-on-accent);
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  transition: background-color 0.2s ease;
  border: none;
  cursor: pointer;
}

.goals-add-button:hover {
  background: var(--secondary-hover);
  color: var(--text-on-accent);
}

.goals-filter-chips {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.goals-filter-chip {
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  background: var(--surface-sunken);
  color: var(--text-label);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-default);
  transition: all 0.2s;
  cursor: pointer;
  font-family: inherit;
}


.goals-filter-chip:hover {
  background: var(--surface-raised);
  border-color: var(--neutral-300);
}

.goals-filter-chip.active {
  background: var(--accent-subtle);
  color: var(--secondary);
  border-color: color-mix(in srgb, var(--secondary) 35%, transparent);
}

.goals-month-section {
  margin-bottom: 2.5rem;
  background: transparent;
}

.goals-cards-wrapper {
  background: var(--surface-raised);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-default);
}

.goals-cards-wrapper .goals-month-header {
  margin-bottom: 1.5rem;
}

.goals-month-section .goals-grid {
  background: transparent;
}

.goals-month-header {
  margin-bottom: 1.5rem;
}

.goals-month-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.goals-month-icon {
  color: var(--gray-700);
  flex-shrink: 0;
}

.goals-month-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--gray-900);
  margin: 0;
}

.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.goals-card {
  --goals-accent: #059669;
  --goals-ring-track: #e5e7eb;
  --goals-surface: var(--neutral-50);
  background: var(--goals-surface);
  border-radius: 16px;
  padding: 1.25rem 1.25rem 1.15rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 14px rgba(15, 23, 42, 0.04);
  border: 1px solid var(--neutral-200);
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.goals-card:hover {
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(15, 23, 42, 0.06);
}

.goals-card--completed {
  opacity: 0.82;
}

.goals-card--compact {
  padding: 1rem 1rem 0.9rem;
}

/* Goal card category themes (light + dark via data-theme) */
.goals-card--torah {
  --goals-accent: #0052cc;
  --goals-ring-track: #dbeafe;
  --goals-surface: #f0f7ff;
}
.goals-card--torah .goals-card-badge {
  background: #e8f4fd;
  color: #0052cc;
}

.goals-card--tefillah {
  --goals-accent: #0d9488;
  --goals-ring-track: #ccfbf1;
  --goals-surface: #f0fdfa;
}
.goals-card--tefillah .goals-card-badge {
  background: #ccfbf1;
  color: #0f766e;
}

.goals-card--middos {
  --goals-accent: #7c3aed;
  --goals-ring-track: #ede9fe;
  --goals-surface: #f5f3ff;
}
.goals-card--middos .goals-card-badge {
  background: #ede9fe;
  color: #6d28d9;
}

.goals-card--chesed {
  --goals-accent: #ea580c;
  --goals-ring-track: #ffedd5;
  --goals-surface: #fff7ed;
}
.goals-card--chesed .goals-card-badge {
  background: #ffedd5;
  color: #c2410c;
}

.goals-card--wellness {
  --goals-accent: #059669;
  --goals-ring-track: #d1fae5;
  --goals-surface: #ecfdf5;
}
.goals-card--wellness .goals-card-badge {
  background: #d1fae5;
  color: #047857;
}

.goals-card--productivity {
  --goals-accent: #2563eb;
  --goals-ring-track: #e5e7eb;
  --goals-surface: #eff6ff;
}
.goals-card--productivity .goals-card-badge {
  background: #dbeafe;
  color: #1d4ed8;
}

.goals-card--learning,
.goals-card--default {
  --goals-accent: #4b5563;
  --goals-ring-track: #e5e7eb;
  --goals-surface: #f9fafb;
}
.goals-card--learning .goals-card-badge,
.goals-card--default .goals-card-badge {
  background: #f3f4f6;
  color: var(--text-label);
}

.goals-card--completed {
  --goals-surface: #ecfdf5;
}

[data-theme="dark"] .goals-card--torah {
  --goals-ring-track: hsl(214, 35%, 24%);
  --goals-surface: hsl(214, 30%, 15%);
}
[data-theme="dark"] .goals-card--torah .goals-card-badge {
  background: hsl(214, 45%, 20%);
  color: #93c5fd;
}

[data-theme="dark"] .goals-card--tefillah {
  --goals-ring-track: hsl(168, 30%, 22%);
  --goals-surface: hsl(168, 28%, 14%);
}
[data-theme="dark"] .goals-card--tefillah .goals-card-badge {
  background: hsl(168, 35%, 18%);
  color: #5eead4;
}

[data-theme="dark"] .goals-card--middos {
  --goals-ring-track: hsl(262, 30%, 24%);
  --goals-surface: hsl(262, 28%, 15%);
}
[data-theme="dark"] .goals-card--middos .goals-card-badge {
  background: hsl(262, 35%, 22%);
  color: #c4b5fd;
}

[data-theme="dark"] .goals-card--chesed {
  --goals-ring-track: hsl(24, 35%, 22%);
  --goals-surface: hsl(24, 30%, 14%);
}
[data-theme="dark"] .goals-card--chesed .goals-card-badge {
  background: hsl(24, 40%, 18%);
  color: #fdba74;
}

[data-theme="dark"] .goals-card--wellness {
  --goals-ring-track: hsl(150, 28%, 22%);
  --goals-surface: hsl(150, 25%, 14%);
}
[data-theme="dark"] .goals-card--wellness .goals-card-badge {
  background: hsl(150, 35%, 18%);
  color: #6ee7b7;
}

[data-theme="dark"] .goals-card--productivity {
  --goals-ring-track: hsl(214, 25%, 24%);
  --goals-surface: hsl(214, 30%, 15%);
}
[data-theme="dark"] .goals-card--productivity .goals-card-badge {
  background: hsl(214, 40%, 20%);
  color: #93c5fd;
}

[data-theme="dark"] .goals-card--learning,
[data-theme="dark"] .goals-card--default {
  --goals-ring-track: hsl(210, 12%, 26%);
  --goals-surface: hsl(210, 14%, 16%);
}
[data-theme="dark"] .goals-card--learning .goals-card-badge,
[data-theme="dark"] .goals-card--default .goals-card-badge {
  background: hsl(210, 12%, 24%);
  color: var(--neutral-700);
}

[data-theme="dark"] .goals-card--completed {
  --goals-surface: hsl(150, 22%, 14%);
}

/* Header */
.goals-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.goals-card-header-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  min-width: 0;
  flex: 1;
}

.goals-card-badge {
  display: inline-block;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.goals-card-streak {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--neutral-500);
  text-transform: uppercase;
}

.goals-card-streak svg {
  color: var(--gray-400);
  flex-shrink: 0;
}

.goals-card-menu-btn {
  border: none;
  background: transparent;
  padding: 0.15rem;
  color: var(--gray-400);
  cursor: pointer;
  border-radius: 6px;
  line-height: 0;
  flex-shrink: 0;
}

.goals-card-menu-btn:hover {
  color: var(--neutral-700);
  background: var(--surface-sunken);
}

.goals-card-done-icon {
  flex-shrink: 0;
  line-height: 0;
}

/* Body */
.goals-card-body {
  cursor: pointer;
  margin-bottom: 1.25rem;
  text-align: left;
}

.goals-card-title {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--neutral-900);
  line-height: 1.3;
  font-family: 'DM Sans', sans-serif;
}

.goals-card--completed .goals-card-title {
  text-decoration: line-through;
  color: var(--gray-400);
}

.goals-card-desc {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--neutral-500);
  line-height: 1.4;
}

.goals-card--completed .goals-card-desc {
  color: var(--gray-400);
}

/* Footer */
.goals-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
}

.goals-card-ring {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.goals-card--compact .goals-card-ring {
  width: 52px;
  height: 52px;
}

.goals-card-ring svg {
  display: block;
}

.goals-card-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--neutral-700);
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.goals-card--compact .goals-card-ring-text {
  font-size: 0.65rem;
}

.goals-card-log-form {
  margin: 0;
  flex-shrink: 0;
}

.goals-card-add-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #ede9fe;
  color: #4c1d95;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.goals-card--compact .goals-card-add-btn {
  width: 40px;
  height: 40px;
}

.goals-card-add-btn:hover {
  background: #ddd6fe;
  transform: scale(1.04);
}

.user-dashboard-goals-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: var(--dash-gap, 0.75rem);
  align-items: start;
}

.user-dashboard-goals-grid .goals-card {
  height: auto;
  min-height: 0;
}

.user-dashboard-goals-grid .goals-card--compact {
  padding: var(--dash-pad, 1rem);
}

.user-dashboard-goals-grid .goals-card--compact .goals-card-header {
  margin-bottom: var(--dash-gap, 0.75rem);
}

.user-dashboard-goals-grid .goals-card--compact .goals-card-body {
  margin-bottom: var(--dash-gap, 0.75rem);
  flex: none;
}

.user-dashboard-goals-grid .goals-card--compact .goals-card-title {
  font-size: 0.9375rem;
  margin-bottom: 0.2rem;
}

.user-dashboard-goals-grid .goals-card--completed .goals-card-title,
.user-dashboard-goals-grid .goals-card.goals-card--completed .goals-card-title {
  text-decoration: none;
  color: var(--gray-600);
}

.user-dashboard-goals-grid .goals-card--compact .goals-card-desc {
  font-size: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.user-dashboard-goals-grid .goals-card--compact .goals-card-footer {
  margin-top: 0;
  justify-content: flex-end;
  gap: 0.35rem;
}

.user-dashboard-goals-grid .goals-card--compact .goals-card-ring {
  width: 48px;
  height: 48px;
}

.user-dashboard-goals-grid .goals-card--compact .goals-card-ring-text {
  font-size: 0.75rem;
}

.user-dashboard-goals-grid .goals-card--compact .goals-card-add-btn {
  width: 36px;
  height: 36px;
}

.goals-empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.goals-empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.goals-empty-state h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.goals-empty-state p {
  color: var(--gray-600);
  margin-bottom: 2rem;
}

.goals-browse-button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  margin-left: 0.75rem;
  transition: all 0.2s;
}

.goals-browse-button:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

/* Responsive adjustments for goals grid */
@media (max-width: 1200px) {
  .goals-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .goals-grid {
    grid-template-columns: 1fr;
  }
}

/* Goal Details Sidebar */
.goals-details-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.goals-details-sidebar.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.goals-details-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.goals-details-sidebar.active .goals-details-overlay {
  opacity: 1;
}

.goals-details-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100%;
  background: var(--white);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  z-index: 1001;
}

.goals-details-sidebar.active .goals-details-panel {
  transform: translateX(0);
}

.goals-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: none;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 10;
}

.goals-details-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

.goals-details-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.goals-details-view-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}

.goals-details-view-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  color: var(--text-heading);
}

.goals-details-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  border-radius: 6px;
  transition: all 0.2s;
}

.goals-details-close:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.goals-details-content {
  padding: 0 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Goal Summary Top Section */
.goals-details-top-section {
  background: linear-gradient(180deg, rgba(99, 206, 22, 0.25) 0%, rgba(255, 255, 255, 1) 60%);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 0;
}

.goals-details-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0 0 0.75rem 0;
}

.goals-details-category {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.goals-details-progress {
  position: relative;
  width: 200px;
  height: 120px;
  margin: 1.5rem auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.goals-details-progress-circle {
  position: absolute;
  top: 0;
  left: 0;
}

.goals-details-progress-text {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 30px;
}

.goals-details-progress-count {
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  color: var(--gray-900);
}

.goals-details-frequency {
  font-size: 12px;
  color: var(--gray-600);
  text-align: center;
}

/* Completion and History Card */
.goals-details-completion-history-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.goals-details-completion-section {
  background: #EFF5F9;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.goals-details-question {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-heading);
  margin: 0 0 1.25rem 0;
  text-align: center;
}

.goals-details-buttons {
  display: flex;
  gap: 0.75rem;
}

.goals-details-buttons form {
  flex: 1;
  display: flex;
}

.goals-details-yes-btn,
.goals-details-no-btn {
  flex: 1;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  transform: scale(1);
}

.goals-details-yes-btn {
  background: #0094E9;
  color: white;
}

.goals-details-yes-btn:hover {
  background: #0077C2;
}

.goals-details-yes-btn.active {
  background: #059669;
  animation: goalMarkSuccess 0.4s ease;
}

.goals-details-yes-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.goals-details-no-btn {
  background: var(--white);
  color: var(--gray-900);
  border: 1px solid var(--gray-200);
}

.goals-details-no-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.goals-details-no-btn.active {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
  animation: goalMarkFailure 0.4s ease;
}

.goals-details-no-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.goals-details-history {
  margin-top: 0;
}

.goals-details-history h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 .7rem 0;
}

.goals-details-history-divider {
  height: 1px;
  background: var(--gray-100);
  margin-bottom: 0;
}

.goals-details-history-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.goals-details-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--gray-100);
  gap: 1rem;
}

.goals-details-history-item:last-child {
  border-bottom: none;
}

.goals-details-history-date {
  font-size: 13px;
  color: var(--text-subtle);
  font-weight: 400;
  white-space: nowrap;
  flex-shrink: 0;
}

.goals-details-history-date strong {
  font-weight: 500;
  display: block;
  font-size: 13px;
  color: var(--text-heading);
}

.goals-details-history-status {
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: white;
}

.goals-details-history-status.completed {
  background: #D1FAE5;
  color: #059669;
}

.goals-details-history-status.not-completed {
  background: var(--gray-200);
  color: var(--gray-600);
}

.goals-details-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 0;
  border-top: none;
}

.goals-details-edit-btn,
.goals-details-delete-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 30px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.goals-details-edit-btn {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.goals-details-edit-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.goals-details-delete-btn {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.goals-details-delete-btn:hover {
  background: var(--danger);
  color: white;
}

.goals-details-delete-btn svg {
  transition: all 0.2s;
}

/* Edit Goal Sidebar */
.goals-edit-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.goals-edit-sidebar.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.goals-edit-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.goals-edit-sidebar.active .goals-edit-overlay {
  opacity: 1;
}

.goals-edit-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100%;
  background: var(--white);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  z-index: 1001;
}

.goals-edit-sidebar.active .goals-edit-panel {
  transform: translateX(0);
}

.goals-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: none;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 10;
}

.goals-edit-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

.goals-edit-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  border-radius: 6px;
  transition: all 0.2s;
}

.goals-edit-close:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.goals-edit-content {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.goals-edit-error {
  background: #FEE2E2;
  color: #DC2626;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.goals-edit-error ul {
  margin: 0;
  padding-left: 1.5rem;
}

.goals-edit-error li {
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.goals-edit-error li:last-child {
  margin-bottom: 0;
}

.goals-edit-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.goals-edit-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-heading);
}

.goals-edit-checkbox {
  width: 18px;
  height: 18px;
  margin-right: 0.5rem;
  cursor: pointer;
}

.goals-edit-input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color 0.2s;
}

.goals-edit-input:focus {
  outline: none;
  border-color: #0094E9;
}

.goals-edit-type-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--gray-100);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.goals-edit-type-field span:first-child {
  color: var(--gray-900);
  font-weight: 500;
}

.goals-edit-type-note {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.goals-edit-recurring-section {
  border: 1px solid var(--gray-100);
  background: var(--gray-50);
  padding: 1.5rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 15px;
}

.goals-edit-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
}

.goals-edit-frequency-buttons {
  display: flex;
  gap: 0.5rem;
}

.goals-edit-frequency-btn {
  flex: 1;
  padding: 0.625rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--white);
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.goals-edit-frequency-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.goals-edit-frequency-btn.active {
  background: #C8E5F7;
  color: var(--text-heading);
  border-color: #C8E5F7;
}

.goals-edit-time-input {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: var(--white);
}

.goals-edit-time-input svg {
  color: var(--gray-600);
  flex-shrink: 0;
}

.goals-edit-time-field {
  border: none;
  background: transparent;
  font-size: 0.875rem;
  color: var(--gray-900);
  flex: 1;
  outline: none;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-edit-additional-reminder {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  width: 100%;
}

.goals-edit-additional-reminder .goals-edit-time-input {
  flex: 1;
  min-width: 0;
}

.goals-edit-add-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #0094E9;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.goals-edit-add-btn:hover {
  background: #0077C2;
}


.goals-edit-active-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  background: var(--white);
  margin-bottom: 1.5rem;
}

.goals-edit-active-toggle>div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.goals-edit-active-toggle .goals-edit-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-heading);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.goals-edit-toggle-desc {
  font-size: 0.8125rem;
  color: var(--gray-600);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.goals-edit-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.goals-edit-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.goals-edit-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #C8E5F7;
  transition: 0.3s;
  border-radius: 24px;
}

.goals-edit-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #447AED;
  transition: 0.3s;
  border-radius: 50%;
}

.goals-edit-switch input:checked+.goals-edit-slider {
  background-color: #C8E5F7;
}

.goals-edit-switch input:checked+.goals-edit-slider:before {
  transform: translateX(20px);
  background-color: #447AED;
}

.goals-edit-switch input:not(:checked)+.goals-edit-slider {
  background-color: var(--gray-300);
}

.goals-edit-switch input:not(:checked)+.goals-edit-slider:before {
  background-color: white;
}

.goals-edit-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.goals-edit-actions-top {
  display: flex;
  gap: 0.75rem;
}

.goals-edit-cancel-btn,
.goals-edit-save-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 30px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.goals-edit-delete-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 30px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.goals-edit-cancel-btn {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.goals-edit-cancel-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.goals-edit-save-btn {
  background: var(--gray-200);
  color: var(--gray-600);
  cursor: not-allowed;
}

.goals-edit-save-btn:enabled {
  background: #0094E9;
  color: white;
  cursor: pointer;
}

.goals-edit-save-btn:enabled:hover {
  background: #0077C2;
}

.goals-edit-delete-btn {
  background: var(--white);
  color: #F04438;
  border: 1px solid #F04438;
}

.goals-edit-delete-btn:hover {
  background: rgba(240, 68, 56, 0.1);
}

.goals-edit-delete-btn svg {
  stroke: currentColor;
}

/* Reflection Journal Page */
.reflection-journal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.reflection-journal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.reflection-journal-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #0094E9;
  color: white;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transition: background 0.2s;
}

.reflection-journal-add-btn:hover {
  background: #0077C2;
}

.reflection-journal-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 1200px) {
  .reflection-journal-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .reflection-journal-cards {
    grid-template-columns: 1fr;
  }
}

.reflection-journal-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  min-height: 200px;
}

.reflection-journal-quote-icon {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.reflection-journal-card-content {
  margin-top: 3.5rem;
}

.reflection-journal-date {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.reflection-journal-text {
  font-size: 0.9375rem;
  color: var(--neutral-500);
  line-height: 1.6;
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.reflection-journal-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.reflection-journal-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: #0094E9;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.reflection-journal-empty {
  text-align: center;
  padding: 4rem 2rem;
}

.reflection-journal-empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.reflection-journal-empty h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.reflection-journal-empty p {
  font-size: 1rem;
  color: var(--gray-600);
  margin-bottom: 1.5rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* New Reflection Modal */
.new-reflection-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.new-reflection-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.new-reflection-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.new-reflection-modal.active .new-reflection-overlay {
  opacity: 1;
}

.new-reflection-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 500px;
  max-width: 90vw;
  height: 100%;
  background: var(--white);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  z-index: 1001;
}

.new-reflection-modal.active .new-reflection-panel {
  transform: translateX(0);
}

.new-reflection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: none;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 10;
}

.new-reflection-header>div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.new-reflection-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.new-reflection-date {
  font-size: 0.875rem;
  color: var(--text-heading);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.new-reflection-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  border-radius: 6px;
  transition: all 0.2s;
  text-decoration: none;
}

.new-reflection-close:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.new-reflection-content {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.new-reflection-form {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.new-reflection-error {
  background: #FEE2E2;
  color: #DC2626;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.new-reflection-error ul {
  margin: 0;
  padding-left: 1.5rem;
}

/* Reflection Prompts Section */
.new-reflection-prompts-section {
  margin-bottom: 2rem;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 1.5rem;
}

.new-reflection-prompts-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.new-reflection-prompts-header svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.new-reflection-prompts-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.new-reflection-prompts-instruction {
  font-size: 13px;
  color: var(--text-subtle);
  margin: 0 0 1rem 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.new-reflection-prompts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.new-reflection-prompt-btn {
  padding: 0.875rem 1rem;
  /* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#447aed+0,d2ffb1+100&0.2+0,0.07+100 */
  background: linear-gradient(to bottom, rgba(68, 122, 237, 0.2) 0%, rgba(210, 255, 177, 0.07) 100%);
  /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */

  border: 1px dashed #ECF2FD;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-heading);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  position: relative;
  overflow: hidden;
  text-align: center;
  font-weight: 400;
}

.new-reflection-prompt-btn:hover {
  opacity: 0.9;
}

/* Text Area Section */
.new-reflection-text-section {
  display: flex;
  flex-direction: column;
  margin-bottom: 2rem;
  position: relative;
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--gray-100);
  padding: 1.5rem;
  min-height: 150px;
}

.new-reflection-textarea {
  width: 100%;
  min-height: 120px;
  padding: 0;
  padding-bottom: 2.5rem;
  border: none;
  border-radius: 0;
  font-size: 0.9375rem;
  color: var(--gray-900);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  resize: vertical;
  line-height: 1.6;
  background: transparent;
}

.new-reflection-textarea:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

.new-reflection-textarea::placeholder {
  color: var(--gray-400);
}

.new-reflection-count {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--gray-900);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  pointer-events: none;
}

/* Actions */
.new-reflection-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 1rem;
}

.new-reflection-save-btn {
  padding: 0.75rem 2rem;
  background: var(--gray-200);
  color: var(--gray-700);
  border: none;
  border-radius: 30px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.new-reflection-save-btn:hover {
  background: var(--gray-300);
}

.new-reflection-save-btn:enabled {
  background: #B9BDC7;
  color: #ffffff;
}

.new-reflection-save-btn:enabled:hover {
  background: var(--gray-300);
}

/* Reflection Details Modal */
.reflection-details-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
}

.reflection-details-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.reflection-details-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.reflection-details-panel {
  position: relative;
  width: 405px;
  max-width: 90vw;
  max-height: 90vh;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 1001;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.reflection-details-modal.active .reflection-details-panel {
  transform: scale(1);
}

.reflection-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
}

.reflection-details-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.reflection-details-quote-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.reflection-details-date {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-heading);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.reflection-details-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  color: var(--gray-900);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.reflection-details-close:hover {
  background: var(--gray-100);
}

.reflection-details-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 1.5rem;
}

.reflection-details-text {
  font-size: 0.9375rem;
  color: var(--gray-900);
  line-height: 1.8;
  white-space: pre-wrap;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 1.25rem;
  background: var(--white);
}

.reflection-details-actions {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
}

.reflection-details-edit-btn,
.reflection-details-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.reflection-details-edit-btn {
  flex: 1;
  background: var(--white);
  color: var(--text-heading);
  border: 1px solid var(--gray-100);
  justify-content: center;
}

.reflection-details-edit-btn:hover {
  background: var(--gray-50);
}

.reflection-details-delete-btn {
  flex: 1;
  background: var(--white);
  color: #F04438;
  border: 1px solid #FCA5A5;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
}

.reflection-details-delete-btn:hover {
  background: #FEF2F2;
  border-color: #F87171;
}

.reflection-details-edit-btn svg,
.reflection-details-delete-btn svg {
  stroke: currentColor;
}

/* Edit Reflection Modal */
.edit-reflection-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.edit-reflection-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.edit-reflection-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.edit-reflection-modal.active .edit-reflection-overlay {
  opacity: 1;
}

.edit-reflection-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100%;
  background: var(--white);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  z-index: 1001;
}

.edit-reflection-modal.active .edit-reflection-panel {
  transform: translateX(0);
}

.edit-reflection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: none;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 10;
}

.edit-reflection-header>div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.edit-reflection-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.edit-reflection-date {
  font-size: 0.875rem;
  color: var(--text-heading);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.edit-reflection-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  border-radius: 6px;
  transition: all 0.2s;
  text-decoration: none;
}

.edit-reflection-close:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.edit-reflection-content {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.edit-reflection-form {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.edit-reflection-error {
  background: #FEE2E2;
  color: #DC2626;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.edit-reflection-error ul {
  margin: 0;
  padding-left: 1.5rem;
}

/* Text Area Section */
.edit-reflection-text-section {
  display: flex;
  flex-direction: column;
  margin-bottom: 2rem;
  position: relative;
  min-height: 200px;
}

.edit-reflection-textarea {
  width: 100%;
  min-height: 150px;
  padding: 1rem;
  padding-bottom: 2.5rem;
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-heading);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  resize: vertical;
  line-height: 1.6;
}

.edit-reflection-textarea:focus {
  outline: none;
  border-color: #0094E9;
  box-shadow: 0 0 0 3px rgba(0, 148, 233, 0.1);
}

.edit-reflection-textarea::placeholder {
  color: var(--gray-400);
}

.edit-reflection-count {
  position: absolute;
  bottom: 0.75rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--gray-500);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  pointer-events: none;
}

/* Actions */
.edit-reflection-actions {
  display: flex;
  gap: 1rem;
  padding-top: 1rem;
}

.edit-reflection-cancel-btn {
  flex: 1;
  padding: 0.75rem 2rem;
  background: var(--white);
  color: var(--text-heading);
  border: 1px solid var(--gray-100);
  border-radius: 30px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.edit-reflection-cancel-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.edit-reflection-save-btn {
  flex: 1;
  padding: 0.75rem 2rem;
  background: #0094E9;
  color: white;
  border: none;
  border-radius: 30px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.edit-reflection-save-btn:hover {
  background: #0077C2;
}

/* New Goal Modal */
.new-goal-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.new-goal-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.new-goal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.new-goal-modal.active .new-goal-overlay {
  opacity: 1;
}

.new-goal-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100%;
  background: var(--white);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  z-index: 1001;
}

.new-goal-modal.active .new-goal-panel {
  transform: translateX(0);
}

.new-goal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: none;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 10;
}

.new-goal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.new-goal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  border-radius: 6px;
  transition: all 0.2s;
  text-decoration: none;
}

.new-goal-close:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.new-goal-content {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.new-goal-form {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.new-goal-error {
  background: #FEE2E2;
  color: #DC2626;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.new-goal-error ul {
  margin: 0;
  padding-left: 1.5rem;
}

.new-goal-form-group {
  margin-bottom: 1.5rem;
}

.new-goal-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.new-goal-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.9375rem;
  color: var(--gray-900);
  background: var(--white);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transition: all 0.2s;
}

.new-goal-input:focus {
  outline: none;
  border-color: #0094E9;
  box-shadow: 0 0 0 3px rgba(0, 148, 233, 0.1);
}

.new-goal-input::placeholder {
  color: var(--gray-400);
}

.new-goal-input select,
select.new-goal-input {
  appearance: none;
  background: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%23565F66' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.new-goal-actions {
  display: flex;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-100);
  margin-top: auto;
}

.new-goal-cancel-btn {
  flex: 1;
  padding: 0.75rem 2rem;
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
  border-radius: 30px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.new-goal-cancel-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.new-goal-submit-btn {
  flex: 1;
  padding: 0.75rem 2rem;
  background: #0094E9;
  color: white;
  border: none;
  border-radius: 30px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.new-goal-submit-btn:hover {
  background: #0077C2;
}

.new-goal-browse-link {
  text-align: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-100);
}

.new-goal-template-link {
  color: #0094E9;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.new-goal-template-link:hover {
  text-decoration: underline;
}

/* Settings Page */
.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.settings-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.settings-content {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Profile Card */
.settings-profile-card {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--gray-100);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.settings-profile-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(0, 148, 233, 0.1) 0%, rgba(255, 255, 255, 1) 60%);
  z-index: 0;
}

.settings-profile-header {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-bottom: 1.5rem;
}

.settings-profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.settings-profile-initial {
  font-size: 3rem;
  font-weight: 700;
  color: var(--white);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.settings-profile-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-heading);
  margin: 0 0 0.2rem 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.settings-profile-email {
  font-size: 13px;
  color: 565F66;
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.settings-profile-actions {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-edit-profile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 30px;
  color: var(--text-heading);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  width: auto;
  margin: 0 auto;
}

.settings-edit-profile-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.settings-social-icons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}

.settings-social-icon {

  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s;
}

.settings-social-icon:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

.settings-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--white);
  border: 1px solid #F04438;
  border-radius: 30px;
  color: #F04438;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  width: 100%;
  cursor: pointer;
}

.settings-logout-btn:hover {
  background: #F04438;
  color: var(--white);
}

/* Settings Cards */
.settings-cards {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-card {
  background: var(--surface-raised);
  border-radius: 12px;
  border: 1px solid var(--border-default);
  padding: 1.5rem;
}

.settings-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--neutral-500);
  margin: 0 0 1rem 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Toggle Items */
.settings-toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 0.75rem 0;
  margin-bottom: 0.75rem;
}

.settings-toggle-item:last-child {
  margin-bottom: 0;
}

.settings-toggle-label {
  flex: 1;
}

.settings-toggle-text {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-heading);
  margin-bottom: 0.1rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.settings-toggle-desc {
  font-size: 13px;
  color: var(--neutral-500);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.settings-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.settings-switch input {
  opacity: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  z-index: 10;
  pointer-events: auto;
}

.settings-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #C8E5F7;
  transition: 0.3s;
  border-radius: 24px;
}

.settings-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #447AED;
  transition: 0.3s;
  border-radius: 50%;
}

.settings-switch input:checked+.settings-slider {
  background-color: #C8E5F7;
}

.settings-switch input:checked+.settings-slider:before {
  transform: translateX(20px);
}

.settings-switch input:not(:checked)+.settings-slider {
  background-color: var(--gray-300);
}

.settings-switch input:not(:checked)+.settings-slider:before {
  background-color: var(--white);
  transform: translateX(0);
}

/* Option Items */
.settings-option-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  margin-bottom: 0.4rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.settings-option-item:last-child {
  margin-bottom: 0;
}

.settings-option-item:hover {
  background-color: var(--gray-50);
}

.settings-option-label {
  flex: 1;
  min-width: 0;
}

.settings-option-text {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-heading);
  margin-bottom: 0.1rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.settings-option-value-text {
  font-size: 13px;
  color: var(--text-subtle);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.settings-option-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-600);
  font-size: 0.9375rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  flex-shrink: 0;
}

/* About Items */
.settings-about-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 0.75rem 0;
  margin-bottom: 0.4rem;
}

.settings-about-item:last-child {
  margin-bottom: 0;
}

/* Settings Modals */
.settings-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.settings-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.settings-modal-content {
  position: relative;
  background: var(--white);
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 2;
  box-shadow: var(--shadow-lg);
}

.settings-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.settings-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.settings-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-500);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.settings-modal-close:hover {
  color: var(--gray-900);
}

.settings-modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-heading);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.settings-form-input {
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.9375rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transition: border-color 0.2s;
}

.settings-form-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(0, 148, 233, 0.1);
}

.settings-form-help {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.settings-modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

.settings-modal-cancel {
  padding: 0.75rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  color: var(--gray-700);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.settings-modal-cancel:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.settings-modal-submit {
  padding: 0.75rem 1.5rem;
  background: var(--secondary);
  border: none;
  border-radius: 8px;
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.settings-modal-submit:hover {
  background: #0077C2;
}

/* Responsive */
@media (max-width: 1024px) {
  .settings-content {
    grid-template-columns: 1fr;
  }

  .settings-profile-card {
    max-width: 500px;
    margin: 0 auto;
  }
}

/* Scheduled Sessions Page */


.sessions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.sessions-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.sessions-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--secondary);
  color: var(--text-on-accent);
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  transition: background-color 0.2s ease;
  border: none;
  cursor: pointer;
}

.sessions-add-btn:hover {
  background: var(--secondary-hover);
  color: var(--text-on-accent);
}

.sessions-cards {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: start;
}

.session-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 1.5rem;
  min-width: 280px;
  flex: 0 0 auto;
  position: relative;
  transition: all 0.2s;
}

.session-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.session-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.session-card-icon svg {
  width: 44px;
  height: 44px;
}

.session-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-heading);
  margin: 0 0 1rem 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.session-card-info {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  flex-wrap: wrap;
}

.session-card-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  color: var(--text-subtle);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.session-card-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  border: 2px dashed var(--gray-300);
  background: var(--gray-50);
  text-decoration: none;
  color: var(--gray-500);
  font-size: 0.9375rem;
  font-weight: 500;
  gap: 0.75rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.session-card-add:hover {
  border-color: #0094E9;
  background: #E6F4FD;
  color: #0094E9;
}

.sessions-empty {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

/* Responsive */
@media (max-width: 768px) {
  .sessions-cards {
    flex-direction: column;
  }

  .session-card {
    width: 100%;
  }
}

/* Session Edit Slide-in Panel */
.session-edit-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.session-edit-sidebar.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.session-edit-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.session-edit-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 500px;
  max-width: 90vw;
  height: 100%;
  background: var(--white);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.session-edit-sidebar.active .session-edit-panel {
  transform: translateX(0);
}

.session-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem;
  border-bottom: 0;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 10;
}

.session-edit-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 0.25rem 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.session-edit-subtitle {
  font-size: 0.8125rem;
  color: var(--text-heading);
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.session-edit-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  color: var(--gray-900);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.session-edit-close:hover {
  background: var(--gray-100);
}

.session-edit-content {
  flex: 1;
  padding: 0 1.5rem 1.5rem;
}

.session-edit-form-group {
  margin-bottom: 1.5rem;
}

.session-edit-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.session-edit-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--gray-900);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--white);
  transition: border-color 0.2s;
}

.session-edit-input:focus {
  outline: none;
  border-color: #0094E9;
}

/* Days of Week Buttons */
.session-edit-days {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.session-edit-day-btn {
  padding: 0.625rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  background: var(--white);
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.session-edit-day-btn:hover {
  border-color: #0094E9;
  color: #0094E9;
}

.session-edit-day-btn.active {
  background: #E6F4FD;
  border-color: #E6F4FD;
  color: #0069A5;
  font-weight: 600;
}

/* Quick Select Buttons */
.session-edit-quick-select {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.session-edit-quick-btn {
  padding: 0.625rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  background: var(--white);
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.session-edit-quick-btn:hover {
  border-color: #0094E9;
  color: #0094E9;
}

.session-edit-quick-btn.active {
  background: #E6F4FD;
  border-color: #E6F4FD;
  color: #0069A5;
  font-weight: 600;
}

/* Select Dropdown */
.session-edit-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.session-edit-select-bell {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--gray-600);
  z-index: 1;
}

.session-edit-select {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 2.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.9375rem;
  color: var(--gray-900);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--white);
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.session-edit-select:focus {
  outline: none;
  border-color: #0094E9;
}

.session-edit-select-arrow {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--gray-600);
}

/* Action Buttons */
.session-edit-actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-100);
}

.session-edit-actions-top {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.session-edit-cancel-btn,
.session-edit-save-btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  border: none;
}

.session-edit-cancel-btn {
  background: var(--white);
  color: var(--text-heading);
  border: 1px solid var(--gray-300);
}

.session-edit-cancel-btn:hover {
  background: var(--gray-50);
}

.session-edit-save-btn {
  background: #B9BDC7;
  color: var(--text-on-accent);
}

.session-edit-save-btn:not(:disabled) {
  background: var(--secondary);
  cursor: pointer;
}

.session-edit-save-btn:not(:disabled):hover {
  background: var(--secondary-hover);
}

.session-edit-save-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.session-edit-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #F04438;
  text-decoration: none;
  border: 1px solid #F04438;
  background: var(--white);
  transition: all 0.2s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  cursor: pointer;
}

.session-edit-delete-btn svg {
  stroke: currentColor;
}

.session-edit-delete-btn:hover {
  background: #F04438;
  color: var(--white);
}

.session-edit-error {
  background: #FEE2E2;
  border: 1px solid #FECACA;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.session-edit-error ul {
  margin: 0;
  padding-left: 1.5rem;
  list-style: disc;
}

.session-edit-error li {
  color: #DC2626;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.session-edit-error li:last-child {
  margin-bottom: 0;
}

/* Goals Show Page */
.goals-show-page {
  padding-bottom: 2rem;
}

.goals-show-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.goals-show-header-content {
  flex: 1;
}

.goals-show-subtitle {
  font-size: 0.875rem;
  color: var(--text-subtle);
  margin: 0.5rem 0 0 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.goals-show-edit-btn,
.goals-show-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  transition: all 0.2s ease;
  border: 1px solid var(--gray-100);
  background: var(--white);
  color: var(--text-heading);
  cursor: pointer;
}

.goals-show-edit-btn:hover {
  background: var(--gray-50);
}

.goals-show-delete-btn {
  color: #F04438;
  border-color: #FCA5A5;
}

.goals-show-delete-btn:hover {
  background: #F04438;
  color: var(--white);
}

.goals-show-delete-btn:hover svg {
  stroke: var(--white);
}

.goals-show-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .goals-show-grid {
    grid-template-columns: 1fr;
  }
}

.goals-show-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 1.5rem;
}

.goals-show-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 1.25rem 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-card-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.goals-show-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gray-100);
}

.goals-show-info-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.goals-show-info-label {
  font-size: 0.875rem;
  color: var(--text-subtle);
  font-weight: 500;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-info-value {
  font-size: 0.875rem;
  color: var(--gray-900);
  font-weight: 500;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-status-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-status-completed {
  background: #D1FAE5;
  color: #059669;
}

.goals-show-status-in-progress {
  background: #FED7AA;
  color: #F97316;
}

.goals-show-progress-section {
  margin-top: 0.5rem;
}

.goals-show-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-700);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-progress-percentage {
  font-weight: 600;
  color: var(--text-heading);
}

.goals-show-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: 9999px;
  overflow: hidden;
}

.goals-show-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.goals-show-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.goals-show-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.goals-show-form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-900);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-form-input,
.goals-show-form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color 0.2s ease;
}

.goals-show-form-input:focus,
.goals-show-form-textarea:focus {
  outline: none;
  border-color: var(--text-heading);
}

.goals-show-form-textarea {
  resize: vertical;
  min-height: 80px;
}

.goals-show-buttons-group {
  display: flex;
  gap: 0.75rem;
}

.goals-show-yes-btn,
.goals-show-no-btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  border: none;
  font-weight: 600;
  font-size: 0.875rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  transform: scale(1);
}

.goals-show-yes-btn {
  background: #0094E9;
  color: var(--white);
}

.goals-show-yes-btn:hover {
  background: #0077C2;
}

.goals-show-yes-btn.active {
  background: #059669;
  animation: goalMarkSuccess 0.4s ease;
}

.goals-show-yes-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.goals-show-no-btn {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-100);
}

.goals-show-no-btn:hover {
  background: var(--gray-50);
}

.goals-show-no-btn.active {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
  animation: goalMarkFailure 0.4s ease;
}

.goals-show-no-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.goals-show-form-hint {
  font-size: 0.75rem;
  color: var(--text-subtle);
  text-align: center;
  margin-top: 0.25rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-submit-btn {
  width: 100%;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  border: none;
  background: #0094E9;
  color: var(--white);
  font-weight: 600;
  font-size: 0.875rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.goals-show-submit-btn:hover {
  background: #0077C2;
}

.goals-show-submit-btn-success {
  background: #10B981;
}

.goals-show-submit-btn-success:hover {
  background: #059669;
}

.goals-show-completed-message {
  text-align: center;
  padding: 1.5rem;
  color: #059669;
  font-weight: 500;
  font-size: 0.875rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.goals-show-history-count {
  font-size: 0.875rem;
  color: var(--text-subtle);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.goals-show-history-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: 4px;
  gap: 1rem;
}

.goals-show-history-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.goals-show-history-date-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.goals-show-history-date {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-900);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-history-time {
  font-size: 0.75rem;
  color: var(--text-subtle);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-history-today-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--primary);
  color: var(--white);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-history-value {
  font-size: 0.875rem;
  color: var(--gray-700);
  font-weight: 500;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-history-unit {
  color: var(--text-subtle);
  margin-left: 0.25rem;
}

.goals-show-history-status {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-history-status-completed {
  background: #D1FAE5;
  color: #059669;
}

.goals-show-history-status-not-completed {
  background: var(--gray-200);
  color: var(--gray-600);
}

.goals-show-history-notes {
  font-size: 0.875rem;
  color: var(--text-subtle);
  font-style: italic;
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-history-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: #F04438;
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.goals-show-history-delete:hover {
  background: #FEE2E2;
}

.goals-show-empty-state {
  text-align: center;
  padding: 2rem;
}

.goals-show-empty-text {
  color: var(--text-subtle);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-empty-hint {
  color: var(--gray-400);
  font-size: 0.75rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================
   COMPREHENSIVE RESPONSIVE STYLES
   ============================================ */

/* Tablet and below (1024px) */
@media (max-width: 1024px) {

  /* Slide Panels - Full width on tablet */
  .goals-edit-panel,
  .new-goal-panel,
  .new-reflection-panel,
  .edit-reflection-panel,
  .session-edit-panel,
  .new-session-panel,
  .template-details-panel {
    width: 100%;
    max-width: 100vw;
  }

  /* Dashboard Grid */
  .user-dashboard-main-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Goals Page */
  .goals-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .goals-filter-chips {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Settings Page */
  .settings-page-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .settings-profile-card {
    margin-bottom: 1.5rem;
  }

  /* Goals Show Page */
  .goals-show-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .goals-show-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {

  /* Container padding */
  .container {
    padding: 0 0.75rem;
  }

  /* User Navbar */
  .user-navbar-content {
    padding: 0.75rem 1rem;
  }

  .user-navbar-center {
    max-width: min(100%, 240px);
  }

  .user-navbar-search {
    display: none;
  }

  /* Sidebar */
  .user-sidebar {
    transform: translateX(-100%);
  }

  .user-sidebar.active {
    transform: translateX(0);
  }

  .user-sidebar-toggle {
    display: flex;
  }

  /* Dashboard */
  .user-dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .user-dashboard-greeting {
    font-size: 1.25rem;
  }

  .user-dashboard-date {
    font-size: 0.875rem;
  }

  .user-dashboard-main-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .user-weekly-goals-grid {
    grid-template-columns: 1fr;
  }

  .user-upcoming-deadlines-cards {
    flex-direction: column;
    gap: 0.75rem;
  }

  /* Goals Page */
  .goals-page-header {
    padding: 1rem 0.75rem;
  }

  .goals-header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
  }

  .goals-add-button {
    width: 100%;
    justify-content: center;
  }

  .goals-filter-chips {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .goals-filter-chip {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .goals-cards-wrapper {
    padding: 1rem;
  }

  .goals-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Goals Show Page */
  .goals-show-page {
    padding: 0 0.75rem 2rem;
  }

  .goals-show-header {
    padding: 1rem 0;
  }

  .goals-show-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .goals-show-edit-btn,
  .goals-show-delete-btn {
    width: 100%;
    justify-content: center;
  }

  .goals-show-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .goals-show-card {
    padding: 1rem;
  }

  .goals-show-buttons-group {
    flex-direction: column;
  }

  /* Slide Panels - Full width on mobile */
  .goals-edit-panel,
  .new-goal-panel,
  .new-reflection-panel,
  .edit-reflection-panel,
  .session-edit-panel,
  .new-session-panel,
  .template-details-panel,
  .goals-details-panel {
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .goals-edit-header,
  .new-goal-header,
  .new-reflection-header,
  .edit-reflection-header,
  .session-edit-header,
  .new-session-header,
  .template-details-header,
  .goals-details-header {
    padding: 1rem;
  }

  .goals-edit-content,
  .new-goal-content,
  .new-reflection-content,
  .edit-reflection-content,
  .session-edit-content,
  .new-session-content,
  .template-details-content,
  .goals-details-content {
    padding: 0 1rem 1rem;
  }

  /* Goal Templates */
  .goal-template-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .goal-template-filters {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  /* Reflections */
  .reflection-journal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .reflection-journal-add-btn {
    width: 100%;
    justify-content: center;
  }

  .reflection-journal-cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Reflection Modal */
  .reflection-details-panel {
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    border-radius: 0;
    max-height: 100vh;
  }

  .reflection-details-header {
    padding: 1rem;
  }

  .reflection-details-content-wrapper {
    padding: 1rem;
  }

  .reflection-details-actions {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }

  .reflection-details-edit-btn,
  .reflection-details-delete-btn {
    width: 100%;
    justify-content: center;
  }

  /* Scheduled Sessions */
  .sessions-page {
    padding: 1rem 0.75rem;
  }

  .sessions-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .sessions-add-btn {
    width: 100%;
    justify-content: center;
  }

  .sessions-cards {
    flex-direction: column;
    gap: 1rem;
  }

  .session-card {
    width: 100%;
  }

  /* Settings */
  .settings-page {
    padding: 1rem 0.75rem;
  }

  .settings-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .settings-page-container {
    grid-template-columns: 1fr;
  }

  .settings-profile-card {
    margin-bottom: 1.5rem;
  }

  .settings-social-icons {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Forms */
  .goals-edit-form-group,
  .new-goal-form-group,
  .session-edit-form-group {
    margin-bottom: 1rem;
  }

  .goals-edit-frequency-buttons {
    flex-direction: column;
  }

  .goals-edit-frequency-btn {
    width: 100%;
  }

  .goals-edit-actions-top {
    flex-direction: column;
  }

  .goals-edit-cancel-btn,
  .goals-edit-save-btn {
    width: 100%;
  }

  .goals-edit-delete-btn {
    width: 100%;
  }

  /* Login/Signup Pages */
  .login-page-container {
    flex-direction: column;
    min-height: 100vh;
    overflow-y: auto;
    position: relative;
    /* Allow scrolling on mobile */
  }

  .login-form-section {
    padding: 2rem 1.5rem;
    width: 100%;
    overflow-y: auto;
    height: auto;
    /* Allow natural height on mobile stack */
    flex: none;
    /* Don't force height if it should stack */
    display: flex;
    flex-direction: column;
  }

  .login-phone-section {
    display: none;
  }

  .login-logo {
    margin-bottom: 1.5rem;
  }

  .login-logo img {
    max-width: 120px;
    height: auto;
  }

  .login-form-group {
    margin-bottom: 1rem;
  }

  .login-input {
    font-size: 16px;
    /* Prevents zoom on iOS */
    padding: 0.75rem 0.875rem;
  }

  .login-submit-btn {
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
  }

  .login-social-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
  }

  .login-divider {
    margin: 1.5rem 0;
  }

  .login-signup-link {
    font-size: 0.8125rem;
  }

  /* Dashboard Sections */
  .user-due-today-items {
    gap: 0.75rem;
  }

  .user-weekly-goal-card {
    padding: 1rem;
  }

  .user-upcoming-deadlines-list {
    gap: 0.5rem;
  }

  .user-upcoming-deadlines-item {
    padding: 0.75rem;
  }

  /* History Items */
  .goals-show-history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .goals-show-history-delete {
    align-self: flex-end;
  }

  .goals-details-history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {

  /* Typography */
  .goals-page-title,
  .goal-template-title,
  .reflection-journal-title,
  .sessions-title,
  .settings-title {
    font-size: 18px;
  }

  .user-dashboard-greeting {
    font-size: 1.125rem;
  }

  /* Cards */
  .goals-card,
  .goal-template-card,
  .reflection-journal-card,
  .session-card {
    padding: 1rem;
  }

  /* Buttons */
  .goals-add-button,
  .goals-show-edit-btn,
  .goals-show-delete-btn,
  .goals-edit-save-btn,
  .goals-edit-cancel-btn {
    font-size: 0.8125rem;
    padding: 0.625rem 1rem;
  }

  /* Forms */
  .goals-edit-input,
  .new-goal-input,
  .session-edit-input {
    font-size: 16px;
    /* Prevents zoom on iOS */
  }

  /* Progress Bars */
  .goals-show-progress-bar {
    height: 6px;
  }

  /* Spacing */
  .goals-show-card,
  .goals-card {
    padding: 0.875rem;
  }

  .goals-edit-content,
  .new-goal-content {
    padding: 0 0.875rem 0.875rem;
  }

  /* Login/Signup Mobile Optimizations */
  .login-page-container {
    padding: 12px;
  }

  .login-form-section {
    padding: 1rem 0.75rem;
  }

  .login-logo {
    margin-bottom: 1.25rem;
  }

  .login-logo img {
    max-width: 100px;
  }

  .login-form-group {
    margin-bottom: 0.875rem;
  }

  .login-label {
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
  }

  .login-input {
    font-size: 16px;
    /* Prevents zoom on iOS */
    padding: 0.6875rem 0.75rem;
  }

  .login-password-wrapper .login-input {
    padding-right: 2.5rem;
  }

  .login-password-toggle {
    right: 0.75rem;
    padding: 0.125rem;
  }

  .login-password-toggle svg {
    width: 18px;
    height: 18px;
  }

  .login-forgot-password {
    margin-bottom: 1.25rem;
  }

  .login-forgot-link {
    font-size: 0.8125rem;
  }

  .login-submit-btn {
    padding: 0.8125rem 1rem;
    font-size: 0.9375rem;
  }

  .login-divider {
    margin: 1.25rem 0;
    font-size: 0.8125rem;
  }

  .login-divider span {
    padding: 0 0.75rem;
  }

  .login-social-buttons {
    gap: 0.625rem;
    margin-bottom: 1.5rem;
  }

  .login-social-btn {
    padding: 0.6875rem 1rem;
    font-size: 0.875rem;
    gap: 0.625rem;
  }

  .login-social-btn img {
    width: 18px;
    height: 18px;
  }

  .login-signup-link {
    font-size: 0.75rem;
    margin-top: 0.75rem;
  }

  .login-signup-btn {
    font-size: 0.75rem;
  }

  .login-error-alert {
    padding: 0.75rem;
    font-size: 0.8125rem;
    margin-bottom: 1.25rem;
  }

  .login-error-alert ul {
    margin: 0.5rem 0 0 1.25rem;
    padding: 0;
  }

  .login-error-alert li {
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
  }
}

/* Very small mobile (360px and below) */
@media (max-width: 360px) {
  .login-page-container {
    padding: 8px;
  }

  .login-form-section {
    padding: 0.875rem 0.5rem;
  }

  .login-logo {
    margin-bottom: 1rem;
  }

  .login-logo img {
    max-width: 90px;
  }

  .login-form-group {
    margin-bottom: 0.75rem;
  }

  .login-input {
    padding: 0.625rem 0.6875rem;
  }

  .login-submit-btn {
    padding: 0.75rem 0.875rem;
  }

  .login-social-btn {
    padding: 0.625rem 0.875rem;
  }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {

  .goals-edit-panel,
  .new-goal-panel,
  .new-reflection-panel,
  .edit-reflection-panel,
  .session-edit-panel,
  .new-session-panel {
    max-height: 100vh;
    overflow-y: auto;
  }

  .goals-edit-content,
  .new-goal-content {
    padding-bottom: 2rem;
  }
}

/* Check-in Progress Visualization */
.goals-show-checkin-graph {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-200);
}

.goals-show-checkin-graph-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-checkin-graph-container {
  margin-bottom: 1rem;
}

.goals-show-checkin-graph-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 150px;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.goals-show-checkin-graph-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  cursor: pointer;
  transition: opacity 0.2s;
}

.goals-show-checkin-graph-bar-wrapper:hover {
  opacity: 0.8;
}

.goals-show-checkin-graph-bar {
  width: 100%;
  background: linear-gradient(to top, #10b981, #34d399);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: opacity 0.2s;
}

.goals-show-checkin-graph-bar-wrapper:hover .goals-show-checkin-graph-bar {
  opacity: 0.9;
}

.goals-show-checkin-graph-bar-label {
  font-size: 0.625rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
  text-align: center;
}

.goals-show-checkin-graph-legend {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.goals-show-checkin-graph-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-checkin-graph-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* ============================================
   Goals Show - Enhanced Visualizations
   ============================================ */

/* Circular Progress for Number + Session Goals */
.goals-show-circular-progress-section {
  margin: 1.5rem 0;
  display: flex;
  justify-content: center;
}

.goals-show-circular-progress {
  position: relative;
  width: 140px;
  height: 140px;
}

.goals-show-circular-progress .circular-progress-svg {
  width: 100%;
  height: 100%;
}

.goals-show-circular-progress .circular-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.goals-show-circular-progress .circular-progress-percentage {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0a0a0a;
  line-height: 1;
}

.goals-show-circular-progress .circular-progress-label {
  font-size: 0.75rem;
  color: #6a7282;
  font-weight: 500;
}

/* Stats Grid for Number + Session Goals */
.goals-show-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.goals-show-stat-card {
  background: #f3f4f6;
  border-radius: 0.5rem;
  padding: 0.75rem;
  text-align: center;
}

.goals-show-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0a0a0a;
  margin: 0;
  line-height: 1.2;
}

.goals-show-stat-value.highlight-blue {
  color: #0095ff;
}

.goals-show-stat-value.highlight-green {
  color: #059669;
}

.goals-show-stat-label {
  font-size: 0.75rem;
  color: #6a7282;
  margin-top: 0.25rem;
  margin: 0;
}

/* Progress Charts */
.goals-show-progress-chart {
  margin-top: 1rem;
}

.goals-show-chart-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6a7282;
  margin-bottom: 1rem;
}

.goals-show-chart-container {
  margin-bottom: 1rem;
  display: flex;
  gap: 0.75rem;
  position: relative;
}

.goals-show-chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.5rem 0;
  min-width: 30px;
  height: 200px;
  border-right: 1px solid #e5e7eb;
  padding-right: 0.5rem;
}

.goals-show-chart-y-label {
  font-size: 0.625rem;
  color: var(--text-subtle);
  text-align: right;
  line-height: 1;
}

.goals-show-chart-bars-container {
  flex: 1;
  position: relative;
  height: 200px;
}

.goals-show-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 100%;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5e7eb;
  position: relative;
}

.goals-show-chart-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  cursor: pointer;
  transition: opacity 0.2s;
  position: relative;
}

.goals-show-chart-bar-wrapper:hover {
  opacity: 0.8;
}

.goals-show-chart-bar-wrapper:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  white-space: nowrap;
  margin-bottom: 0.5rem;
  z-index: 10;
}

.goals-show-chart-bar {
  width: 100%;
  background: linear-gradient(to top, #0095ff, #3b82f6);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: all 0.2s;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.25rem;
}

.goals-show-chart-bar.target-reached {
  background: linear-gradient(to top, #10b981, #059669);
}

.goals-show-chart-bar-value {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-body);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  position: absolute;
  top: -1.5rem;
  z-index: 5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.goals-show-chart-bar-wrapper:hover .goals-show-chart-bar {
  opacity: 0.9;
  transform: scaleY(1.02);
}

.goals-show-chart-bar-label {
  font-size: 0.625rem;
  color: var(--text-subtle);
  margin-top: 0.5rem;
  text-align: center;
  font-weight: 500;
}

.goals-show-chart-target-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #10b981;
  border-top: 1px dashed #059669;
  z-index: 2;
  pointer-events: none;
}

.goals-show-chart-target-label {
  position: absolute;
  right: 0;
  top: -1.25rem;
  font-size: 0.625rem;
  color: #059669;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.goals-show-chart-legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  justify-content: center;
}

.goals-show-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.goals-show-chart-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

/* Session Schedule Info */
.goals-show-session-schedule-info {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f3f4f6;
  border-radius: 0.5rem;
}

.goals-show-session-schedule-label {
  font-size: 0.875rem;
  color: #6a7282;
  margin-bottom: 0.5rem;
  display: block;
}

.goals-show-session-schedule-value {
  font-weight: 600;
  color: #0a0a0a;
  font-size: 0.875rem;
}

/* History Enhancements for Session Goals */
.goals-show-history-duration-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: #e0f2ff;
  color: #0095ff;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 0.5rem;
}

.goals-show-history-session-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.goals-show-history-status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.goals-show-history-status-badge.attended {
  background: #d1fae5;
  color: #047857;
}

.goals-show-history-status-badge.missed {
  background: #fee2e2;
  color: #b91c1c;
}

.goals-show-history-goal-status {
  font-size: 1rem;
  font-weight: 600;
}

.goals-show-history-goal-status.goal-met {
  color: #059669;
}

.goals-show-history-goal-status.goal-not-met {
  color: #dc2626;
}

/* Highlight Colors */
.highlight-blue {
  color: #0095ff !important;
  font-weight: 700;
}

.highlight-green {
  color: #059669 !important;
  font-weight: 700;
}

/* Responsive Charts */
@media (max-width: 768px) {
  .goals-show-chart-bars {
    height: 120px;
    gap: 2px;
  }

  .goals-show-chart-bar-label {
    font-size: 0.5rem;
  }

  .goals-show-stats-grid {
    gap: 0.5rem;
  }

  .goals-show-stat-card {
    padding: 0.5rem;
  }

  .goals-show-stat-value {
    font-size: 1.25rem;
  }
}

/* Print Styles */
@media print {

  .user-sidebar,
  .user-navbar,
  .goals-edit-sidebar,
  .new-goal-modal,
  .new-reflection-modal,
  .edit-reflection-modal,
  .session-edit-sidebar,
  .new-session-modal,
  .template-details-sidebar,
  .goals-details-sidebar {
    display: none;
  }

  .goals-show-page,
  .goals-page {
    padding: 0;
  }
}

/* ============================================
   Goal Page Layout (React Prototype Style)
   ============================================ */

.goal-page-layout {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.goal-page-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.goal-page-header-content {
  flex: 1;
}

.goal-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0a0a0a;
  margin-bottom: 0.25rem;
}

.goal-page-subtitle {
  font-size: 0.875rem;
  color: #6a7282;
}

.goal-page-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.goal-page-edit-btn,
.goal-page-delete-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
  cursor: pointer;
  background: transparent;
}

.goal-page-edit-btn {
  color: #0a0a0a;
}

.goal-page-edit-btn:hover {
  background: #f3f3f5;
}

.goal-page-delete-btn {
  color: #dc2626;
}

.goal-page-delete-btn:hover {
  background: #fee2e2;
}

/* Main Grid - Two Columns */
.goal-page-main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 1024px) {
  .goal-page-main-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Progress Summary (Left Column) */
.goal-page-progress-summary {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

@media (min-width: 1024px) {
  .goal-page-progress-summary {
    border-bottom: none;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
  }
}

.goal-page-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0a0a0a;
  margin-bottom: 1.25rem;
}

.goal-page-progress-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.goal-page-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.goal-page-info-label {
  font-size: 0.875rem;
  color: #6a7282;
}

.goal-page-info-value {
  font-size: 0.875rem;
  color: #0a0a0a;
  font-weight: 700;
}

.goal-page-info-value.highlight-blue {
  color: #0095ff;
}

.goal-page-info-value.highlight-green {
  color: #059669;
}

.goal-page-info-value.highlight-orange {
  color: #d97706;
}

/* Circular Progress */
.goal-page-circular-progress {
  display: flex;
  justify-content: center;
  position: relative;
}

.circular-progress-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circular-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.circular-progress-percentage {
  font-size: 1.875rem;
  font-weight: 700;
  color: #0a0a0a;
}

.circular-progress-label {
  font-size: 0.75rem;
  color: #6a7282;
  margin-top: 0.25rem;
}

.goal-complete-emoji {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  margin-top: 2rem;
}

/* Progress Bar */
.goal-page-progress-bar-section {
  width: 100%;
}

.goal-page-progress-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.goal-page-progress-label {
  font-size: 0.875rem;
  color: #6a7282;
}

.goal-page-progress-percentage {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0a0a0a;
}

.goal-page-progress-bar {
  width: 100%;
  background: #e5e7eb;
  border-radius: 9999px;
  height: 0.5rem;
  overflow: hidden;
}

.goal-page-progress-fill {
  height: 100%;
  background: #0a0a0a;
  border-radius: 9999px;
  transition: width 0.5s ease-out;
}

/* Stats Grid */
.goal-page-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.goal-page-stat-card {
  background: #f3f4f6;
  border-radius: 0.5rem;
  padding: 0.75rem;
  text-align: center;
}

.goal-page-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0a0a0a;
}

.goal-page-stat-value.highlight-green {
  color: #059669;
}

.goal-page-stat-label {
  font-size: 0.75rem;
  color: #6a7282;
  margin-top: 0.25rem;
}

/* Session Stat Card */
.goal-page-session-stat-card {
  background: #e0f2ff;
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.goal-page-session-stat-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0a0a0a;
}

.goal-page-session-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0095ff;
}

/* Completion Status */
.goal-page-completion-status {
  text-align: center;
  padding: 2rem 0;
}

.goal-completion-icon {
  width: 8rem;
  height: 8rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.goal-completion-icon.completed {
  font-size: 4rem;
}

.goal-completion-icon.pending {
  background: #f3f4f6;
  border-radius: 50%;
}

.goal-completion-text {
  font-size: 1.125rem;
  font-weight: 700;
}

.goal-completion-text.completed {
  color: #059669;
}

.goal-completion-text.pending {
  color: #6a7282;
}

/* Log Progress (Right Column) */
.goal-page-log-progress {
  padding: 1.5rem;
}

.goal-log-progress-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Session Timer Card */
.goal-session-timer-card {
  background: #f3f4f6;
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.goal-session-timer-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.goal-timer-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: #6a7282;
}

.goal-session-timer-label {
  font-size: 0.875rem;
  color: #6a7282;
}

.goal-session-timer-display {
  text-align: center;
  margin-bottom: 1rem;
}

.goal-session-timer-time {
  font-size: 3rem;
  font-weight: 700;
  color: #0a0a0a;
}

.goal-session-timer-time-large {
  font-size: 2.5rem;
  font-weight: 700;
  color: #0a0a0a;
}

.goal-session-start-btn,
.goal-session-end-btn {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: #0095ff;
  color: white;
  font-weight: 700;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.2s;
}

.goal-session-start-btn:hover {
  background: #0077cc;
}

.goal-session-end-btn {
  background: #dc2626;
}

.goal-session-end-btn:hover {
  background: #b91c1c;
}

.goal-session-completed-message {
  padding: 0.75rem;
  background: #d1fae5;
  border-radius: 0.75rem;
  text-align: center;
}

.goal-session-completed-text {
  font-size: 0.875rem;
  font-weight: 700;
  color: #047857;
}

/* Progress Entry */
.goal-progress-entry {
  width: 100%;
}

.goal-progress-entry-label {
  display: block;
  font-size: 0.875rem;
  color: #6a7282;
  margin-bottom: 0.5rem;
}

.goal-progress-entry-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.goal-progress-decrement-btn,
.goal-progress-increment-btn {
  width: 3rem;
  height: 3rem;
  background: #f3f4f6;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.goal-progress-decrement-btn:hover,
.goal-progress-increment-btn:hover {
  background: #e5e7eb;
}

.goal-progress-decrement-btn:disabled,
.goal-progress-increment-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.goal-progress-input-wrapper {
  flex: 1;
  position: relative;
}

.goal-progress-input-prefix {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6a7282;
  font-size: 1.25rem;
  font-weight: 700;
}

.goal-progress-value-input {
  width: 100%;
  padding: 0.75rem 1rem;
  padding-left: 2.75rem;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  text-align: center;
  font-size: 1.125rem;
  font-weight: 700;
  color: #0a0a0a;
  outline: none;
}

.goal-progress-value-input:focus {
  ring: 2px;
  ring-color: #0095ff;
}

.goal-progress-value-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Quick Add Buttons */
.goal-quick-add-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.goal-quick-add-btn {
  padding: 0.5rem 0.75rem;
  background: #f3f4f6;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0a0a0a;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.goal-quick-add-btn:hover {
  background: #e5e7eb;
}

.goal-quick-add-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Completion Card */
.goal-completion-card {
  background: #f3f4f6;
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.goal-completion-question {
  font-size: 1rem;
  font-weight: 700;
  color: #0a0a0a;
  text-align: center;
  margin-bottom: 1rem;
}

.goal-completion-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.goal-completion-yes-btn,
.goal-completion-no-btn {
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  transform: scale(1);
}

.goal-completion-yes-btn {
  background: #0095ff;
  color: white;
}

.goal-completion-yes-btn:hover {
  background: #0077cc;
}

.goal-completion-yes-btn.active {
  background: #059669;
  animation: goalMarkSuccess 0.4s ease;
}

.goal-completion-yes-btn.disabled {
  background: #e5e7eb;
  color: #6a7282;
  cursor: not-allowed;
  opacity: 0.6;
}

.goal-completion-no-btn {
  background: white;
  color: #0a0a0a;
  border: 2px solid #d1d5dc;
}

.goal-completion-no-btn:hover {
  background: #f9fafb;
}

.goal-completion-no-btn.active {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
  animation: goalMarkFailure 0.4s ease;
}

.goal-completion-no-btn.disabled {
  background: #e5e7eb;
  color: #6a7282;
  cursor: not-allowed;
  border-color: #e5e7eb;
  opacity: 0.6;
}

.goal-completion-result {
  padding: 1rem;
  border-radius: 0.75rem;
  text-align: center;
  margin-top: 1rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.goal-completion-result.success {
  background: #d1fae5;
  color: #047857;
  animation: goalResultSlideIn 0.3s ease forwards;
}

.goal-completion-result.failure {
  background: #fee2e2;
  color: #b91c1c;
  animation: goalResultSlideIn 0.3s ease forwards;
}

.goal-completion-result-text {
  font-size: 0.875rem;
  font-weight: 700;
}

/* Animations for goal marking */
@keyframes goalMarkSuccess {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.95);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes goalMarkFailure {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.95);
  }

  100% {
    transform: scale(1);
  }
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.goal-completion-change {
  text-align: center;
}

.goal-change-response-btn {
  font-size: 0.875rem;
  color: #6a7282;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s;
}

.goal-change-response-btn:hover {
  color: #0a0a0a;
}

/* Buttons */
.goal-save-progress-btn,
.goal-update-progress-btn,
.goal-mark-complete-btn {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: #0095ff;
  color: white;
  font-weight: 700;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.goal-save-progress-btn:hover,
.goal-update-progress-btn:hover {
  background: #0077cc;
}

.goal-mark-complete-btn {
  background: #059669;
  margin-top: 0.5rem;
}

.goal-mark-complete-btn:hover {
  background: #047857;
}

.goal-completed-message {
  padding: 1rem;
  border-radius: 0.75rem;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  text-align: center;
}

.goal-completed-text {
  font-size: 0.875rem;
  font-weight: 700;
  color: #047857;
}

/* Completion Animation for Boolean One-Time */
.goal-completed-animation {
  position: relative;
  overflow: hidden;
}

.goal-completed-trophy {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  display: block;
  animation: trophyBounce 0.6s ease;
}

.goal-completed-animation.animate .goal-completed-trophy {
  animation: trophyBounce 0.6s ease, trophyRotate 0.5s ease 0.3s;
}

@keyframes trophyBounce {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-20px) scale(1.1);
  }
}

@keyframes trophyRotate {
  0% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-10deg);
  }

  75% {
    transform: rotate(10deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

/* Missed Check-ins Section */
.goal-missed-checkins-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

.goal-checkins-subtitle {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 1rem;
}

.goal-missed-checkins-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.goal-missed-checkin-day {
  background: var(--gray-50);
  border-radius: 0.5rem;
  padding: 1rem;
}

.goal-missed-checkin-date {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.75rem;
}

.goal-missed-checkins-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Date Selector for Number Recurring */
.goal-log-date-section {
  margin-bottom: 1.5rem;
}

.goal-date-selector {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.goal-date-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  background: var(--white);
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.goal-date-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.goal-date-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--text-heading);
}

.goal-previous-date-picker {
  margin-top: 0.75rem;
}

.goal-date-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.goal-progress-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.goal-mark-today-complete-btn {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: var(--gray-100);
  color: var(--gray-700);
  font-weight: 600;
  border-radius: 0.75rem;
  border: 1px solid var(--gray-300);
  cursor: pointer;
  transition: all 0.2s;
}

.goal-mark-today-complete-btn:hover {
  background: var(--gray-200);
  border-color: var(--gray-400);
}

.goal-today-complete-message {
  padding: 0.75rem;
  background: #d1fae5;
  border-radius: 0.75rem;
  text-align: center;
}

.goal-today-complete-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: #047857;
}

/* Notes Section */
.goal-notes-section {
  width: 100%;
}

.goal-notes-label {
  display: block;
  font-size: 0.875rem;
  color: #6a7282;
  margin-bottom: 0.5rem;
}

.goal-notes-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #0a0a0a;
  resize: none;
  outline: none;
  font-family: inherit;
}

.goal-notes-textarea:focus {
  ring: 2px;
  ring-color: #0095ff;
}

.goal-notes-textarea::placeholder {
  color: #99a1af;
}

/* Session Success Message */
.goal-session-success-message {
  padding: 1rem;
  border-radius: 0.75rem;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
}

.goal-session-success-text {
  font-size: 0.875rem;
  text-align: center;
  color: #047857;
}

.goal-session-success-icon {
  font-weight: 700;
}

.goal-session-success-message-text {
  font-weight: 700;
}

/* History Section */
.goal-page-history {
  padding: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: #fafbfc;
}

.goal-page-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.goal-page-history-content {
  width: 100%;
}

.goal-history-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.goal-history-count {
  font-size: 0.875rem;
  color: #6a7282;
  margin-bottom: 0.75rem;
}

.goal-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.goal-history-item {
  padding: 1rem;
  background: white;
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.goal-history-item-content {
  flex: 1;
}

.goal-history-date-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.goal-history-date {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0a0a0a;
}

.goal-history-time {
  font-size: 0.75rem;
  color: #6a7282;
}

.goal-history-duration-badge {
  font-size: 0.75rem;
  background: #e0f2ff;
  color: #0095ff;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

.goal-history-value {
  font-size: 1rem;
  font-weight: 700;
  color: #0a0a0a;
  margin-bottom: 0.25rem;
}

.goal-history-unit {
  font-size: 0.875rem;
  color: #6a7282;
  font-weight: 400;
}

.goal-history-status {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.goal-history-status.completed {
  color: #059669;
}

.goal-history-status.not-completed {
  color: #dc2626;
}

.goal-history-status-icon {
  width: 1rem;
  height: 1rem;
}

.goal-history-notes {
  font-size: 0.875rem;
  color: #6a7282;
  font-style: italic;
  margin-top: 0.25rem;
}

.goal-history-delete {
  color: #dc2626;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.goal-history-delete:hover {
  background: #fee2e2;
}

.goal-history-empty {
  font-size: 0.875rem;
  text-align: center;
  color: #99a1af;
  padding: 2rem 0;
}

/* Check-ins Section */
.goal-checkins-section {
  width: 100%;
}

.goal-checkins-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0a0a0a;
  margin-bottom: 1rem;
}

.goal-checkins-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Check-in Section Styles - Matching Site Design */
.goals-show-checkins-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.goals-show-checkins-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 0.5rem 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-checkins-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.goals-show-checkin-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  transition: all 0.2s ease;
}

.goals-show-checkin-card:hover {
  border-color: var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.goals-show-checkin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.goals-show-checkin-time-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.goals-show-checkin-time-icon {
  width: 16px;
  height: 16px;
  color: var(--gray-500);
  flex-shrink: 0;
}

.goals-show-checkin-time {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-900);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-checkin-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-checkin-status-badge.pending {
  background: #FEF3C7;
  color: #92400E;
}

.goals-show-checkin-status-badge.pass {
  background: #D1FAE5;
  color: #059669;
}

.goals-show-checkin-status-badge.fail {
  background: #FEE2E2;
  color: #DC2626;
}

.goals-show-checkin-actions {
  display: flex;
  gap: 0.75rem;
}

.goals-show-checkin-form {
  flex: 1;
  margin: 0;
}

.goals-show-checkin-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.goals-show-checkin-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.goals-show-checkin-btn-pass {
  background: #0094E9;
  color: var(--white);
}

.goals-show-checkin-btn-pass:hover {
  background: #0077C2;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.goals-show-checkin-btn-pass:active {
  transform: translateY(0);
}

.goals-show-checkin-btn-fail {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.goals-show-checkin-btn-fail:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.goals-show-checkin-btn-fail:active {
  transform: translateY(0);
}

.goals-show-checkin-summary {
  display: flex;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-100);
  margin-top: 0.5rem;
}

.goals-show-checkin-summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.goals-show-checkin-summary-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 500;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.goals-show-checkin-summary-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Responsive */
@media (max-width: 1023px) {
  .goal-page-main-grid {
    grid-template-columns: 1fr;
  }

  .goal-page-progress-summary {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    border-right: none;
  }
}

/* ============================================
   Goals Index - Scenario Selector
   ============================================ */

.goals-index-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.goals-index-section-icon {
  color: #6a7282;
  flex-shrink: 0;
}

.goals-index-section-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0a0a0a;
  margin: 0;
}

.goals-scenario-selector-card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.goals-scenario-selector-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: #6a7282;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.goals-scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (max-width: 1024px) {
  .goals-scenario-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .goals-scenario-grid {
    grid-template-columns: 1fr;
  }
}

.goals-scenario-card {
  position: relative;
  padding: 1rem;
  border-radius: 0.75rem;
  text-align: left;
  transition: all 0.2s;
  border: 2px solid transparent;
  background: #f9fafb;
  cursor: pointer;
  width: 100%;
}

.goals-scenario-card:hover {
  border-color: #d1d5dc;
}

.goals-scenario-card.selected {
  background: #dbeafe;
  border-color: #0095ff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.goals-scenario-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.goals-scenario-category {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6a7282;
  text-transform: uppercase;
}

.goals-scenario-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0a0a0a;
  margin: 0;
}

.goals-scenario-checkmark {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 20px;
  height: 20px;
  background: #0095ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#selected-goal-detail {
  margin-top: 2rem;
}

/* Date Selector for Logging Progress */
.goals-show-date-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.goals-show-date-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: var(--white);
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.goals-show-date-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.goals-show-date-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--text-heading);
}

.goals-show-date-picker {
  margin-top: 0.75rem;
}

.goals-show-date-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--gray-900);
}

.goals-show-date-input:focus {
  outline: none;
  border-color: var(--text-heading);
  box-shadow: 0 0 0 3px rgba(68, 122, 237, 0.1);
}


/* Sub-goal hierarchy — goal detail */
.goal-detail-grid--with-sub-goals {
  grid-template-areas:
    "overview right"
    "consistency right"
    "reflection reflection"
    "subgoals subgoals";
}

.goal-detail-page--one-time .goal-detail-grid--with-sub-goals {
  grid-template-areas:
    "overview right"
    "reflection reflection"
    "subgoals subgoals";
}

.goal-detail-cell--sub-goals {
  grid-area: subgoals;
}

.goal-detail-sub-goals {
  padding: 1.25rem 1.5rem;
}

.goal-detail-sub-goals__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.goal-detail-sub-goals__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-subtle);
  line-height: 1.45;
}

.goal-detail-sub-goals__subtitle strong {
  color: var(--text-heading);
  font-weight: 600;
}

.goal-detail-sub-goals__add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--secondary) 35%, var(--border-default));
  background: var(--accent-subtle);
  color: var(--secondary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.goal-detail-sub-goals__add-btn:hover {
  background: #e0efff;
  border-color: #0052cc;
}

.goal-detail-sub-goals__summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.goal-detail-sub-goals__summary-text {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--text-subtle);
}

.goal-detail-sub-goals__count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.goal-detail-sub-goals__count-sep {
  font-weight: 500;
  color: var(--gray-400);
  margin: 0 0.1rem;
}

.goal-detail-sub-goals__pct {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--secondary);
}

.goal-detail-sub-goals__track {
  height: 8px;
  background: var(--surface-sunken);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.goal-detail-sub-goals__track-fill {
  height: 100%;
  background: linear-gradient(90deg, #0052cc, #447aed);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.goal-detail-sub-goals__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.goal-detail-sub-goals__row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--surface-raised);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.goal-detail-sub-goals__row:hover {
  border-color: #93b8f0;
  box-shadow: 0 2px 8px rgba(0, 82, 204, 0.08);
}

.goal-detail-sub-goals__row--completed {
  background: var(--success-bg);
  border-color: color-mix(in srgb, var(--success) 35%, var(--border-default));
}

.goal-detail-sub-goals__row--in_progress {
  border-color: color-mix(in srgb, var(--secondary) 35%, var(--border-default));
  background: var(--accent-subtle);
}

.goal-detail-sub-goals__step {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-400);
  min-width: 1.25rem;
  text-align: center;
}

.goal-detail-sub-goals__check {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.goal-detail-sub-goals__check--completed {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

.goal-detail-sub-goals__check--in_progress {
  border-color: #0052cc;
  background: #e8f4fd;
}

.goal-detail-sub-goals__check-icon {
  color: #fff;
}

.goal-detail-sub-goals__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.goal-detail-sub-goals__name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-heading);
}

.goal-detail-sub-goals__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.goal-detail-sub-goals__status-pill {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.goal-detail-sub-goals__status-pill--completed {
  background: #d1fae5;
  color: #047857;
}

.goal-detail-sub-goals__status-pill--in_progress {
  background: #dbeafe;
  color: #1d4ed8;
}

.goal-detail-sub-goals__status-pill--pending {
  background: #f3f4f6;
  color: var(--text-subtle);
}

.goal-detail-sub-goals__due {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.goal-detail-sub-goals__due--overdue {
  color: #dc2626;
  font-weight: 600;
}

.goal-detail-sub-goals__mini-track {
  height: 4px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.goal-detail-sub-goals__mini-fill {
  display: block;
  height: 100%;
  background: #0052cc;
  border-radius: 999px;
}

.goal-detail-sub-goals__chevron {
  color: var(--gray-400);
  flex-shrink: 0;
}

.goal-detail-sub-goals--empty {
  text-align: center;
  padding: 2rem 1.5rem;
}

.goal-detail-sub-goals__empty-icon {
  color: #0052cc;
  margin-bottom: 1rem;
  opacity: 0.85;
}

.goal-detail-sub-goals__empty-text {
  color: var(--text-subtle);
  font-size: 0.9375rem;
  line-height: 1.5;
  max-width: 28rem;
  margin: 0 auto 1rem;
}

.goal-detail-sub-goals__empty-tips {
  text-align: left;
  max-width: 22rem;
  margin: 0 auto 1.25rem;
  padding-left: 1.25rem;
  color: var(--text-subtle);
  font-size: 0.875rem;
  line-height: 1.6;
}

.goal-detail-sub-goals__empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: #0052cc;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.goal-detail-sub-goals__empty-cta:hover {
  background: #0047b3;
  color: #fff;
}

.goal-detail-sub-goals-container-note {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-top: 1rem;
  padding: 1rem;
  background: #f0f7ff;
  border: 1px solid #c5d9f0;
  border-radius: 10px;
  color: #1e3a5f;
  font-size: 0.875rem;
  line-height: 1.5;
}

.goal-detail-sub-goals-container-note p {
  margin: 0;
}

/* Sub-goal modal (centered) */
.sub-goal-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sub-goal-modal.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.sub-goal-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 16, 26, 0.5);
  backdrop-filter: blur(4px);
}

.sub-goal-modal__dialog {
  position: relative;
  width: min(100%, 32rem);
  max-height: calc(100vh - 2.5rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface-raised);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(3, 16, 26, 0.16), 0 8px 16px rgba(3, 16, 26, 0.08);
  border: 1px solid #e8ecf0;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
}

.sub-goal-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.35rem 1.1rem;
  border-bottom: 1px solid #f0f2f5;
  flex-shrink: 0;
}

.sub-goal-modal__header-text {
  min-width: 0;
}

.sub-goal-modal__eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0094e9;
}

.sub-goal-modal__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.25;
}

.sub-goal-modal__subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-subtle);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 22rem;
}

.sub-goal-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border: none;
  background: transparent;
  border-radius: 10px;
  color: var(--gray-400);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.sub-goal-modal__close:hover {
  background: #f3f4f6;
  color: var(--text-heading);
}

.sub-goal-modal__form {
  padding: 1.25rem 1.35rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
  overflow-y: auto;
}

.sub-goal-modal__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sub-goal-modal__field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.sub-goal-modal__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-label);
  line-height: 1.3;
}

.sub-goal-modal__hint {
  font-size: 0.75rem;
  color: var(--gray-400);
  line-height: 1.3;
  margin-top: -0.1rem;
}

.sub-goal-modal__input {
  width: 100%;
  padding: 0.6875rem 0.875rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--text-heading);
  background: #fafbfc;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.sub-goal-modal__input::placeholder {
  color: var(--gray-400);
}

.sub-goal-modal__input:hover {
  border-color: #d1d5db;
  background: var(--surface-raised);
}

.sub-goal-modal__input:focus {
  outline: none;
  border-color: #0094e9;
  background: var(--surface-raised);
  box-shadow: 0 0 0 3px rgba(0, 148, 233, 0.14);
}

.sub-goal-modal__textarea {
  resize: none;
  min-height: 5rem;
  line-height: 1.5;
}

.sub-goal-modal__input--date {
  color-scheme: light;
}

.sub-goal-modal__priority-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.25rem;
  background: #f4f6f8;
  border-radius: 12px;
}

.sub-goal-modal__priority-option {
  position: relative;
  cursor: pointer;
}

.sub-goal-modal__priority-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.sub-goal-modal__priority-option span {
  display: block;
  text-align: center;
  padding: 0.5625rem 0.5rem;
  border-radius: 9px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-subtle);
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.sub-goal-modal__priority-option input:focus-visible + span {
  outline: 2px solid #0094e9;
  outline-offset: 2px;
}

.sub-goal-modal__priority-option input:checked + span {
  background: var(--surface-raised);
  color: var(--text-heading);
  box-shadow: 0 1px 3px rgba(3, 16, 26, 0.08);
}

.sub-goal-modal__priority-option--low input:checked + span {
  color: #047857;
}

.sub-goal-modal__priority-option--medium input:checked + span {
  color: #0094e9;
}

.sub-goal-modal__priority-option--high input:checked + span {
  color: #c2410c;
}

.sub-goal-modal__footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.625rem;
  margin-top: 0.25rem;
  padding-top: 1.125rem;
  border-top: 1px solid #f0f2f5;
}

.sub-goal-modal__cancel {
  padding: 0.6875rem 1.125rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--text-label);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sub-goal-modal__cancel:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.sub-goal-modal__submit {
  padding: 0.6875rem 1.25rem;
  border: none;
  border-radius: 10px;
  background: #0094e9;
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.sub-goal-modal__submit:hover {
  background: #0080c7;
}

.sub-goal-modal__submit:active {
  transform: scale(0.98);
}

@media (max-width: 520px) {
  .sub-goal-modal {
    padding: 0;
    align-items: flex-end;
  }

  .sub-goal-modal__dialog {
    width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
  }

  .sub-goal-modal__field-row {
    grid-template-columns: 1fr;
  }

  .sub-goal-modal__subtitle {
    white-space: normal;
    max-width: none;
  }

  .sub-goal-modal__footer {
    flex-direction: column-reverse;
  }

  .sub-goal-modal__cancel,
  .sub-goal-modal__submit {
    width: 100%;
    text-align: center;
  }
}

.sub-goal-modal__errors {
  display: none;
  margin: 0 1.35rem 0.5rem;
  padding: 0.75rem 0.875rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  font-size: 0.8125rem;
  color: #b91c1c;
  flex-shrink: 0;
}

.sub-goal-modal__errors--visible {
  display: block;
}

.sub-goal-modal__errors ul {
  margin: 0;
  padding-left: 1.1rem;
}

/* Sub-goals embedded in overview (no grid changes) */
.goal-detail-sub-goals-embed {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e8f4f8;
}

.goal-detail-sub-goals-cta {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e8f4f8;
}

.goal-detail-sub-goals-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0;
  border: none;
  background: none;
  color: #0052cc;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.goal-detail-sub-goals-cta__btn:hover {
  text-decoration: underline;
}

.goal-detail-overview .goal-detail-sub-goals {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.goal-detail-sub-goals__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.625rem;
}

.goal-detail-sub-goals__bar-left {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}

.goal-detail-sub-goals__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
}

.goal-detail-sub-goals__count {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-heading);
}

.goal-detail-sub-goals__add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s;
}

.goal-detail-sub-goals__add:hover {
  background: var(--accent-subtle);
  border-color: color-mix(in srgb, var(--secondary) 45%, var(--border-default));
}

.goal-detail-overview .goal-detail-sub-goals__track {
  height: 4px;
  margin-bottom: 0.75rem;
}

.goal-detail-sub-goals__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.goal-detail-sub-goals__item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.4375rem 0.25rem;
  border-radius: 8px;
  transition: background 0.12s;
}

.goal-detail-sub-goals__item:hover {
  background: var(--surface-sunken);
}

.goal-detail-sub-goals__item.is-done .goal-detail-sub-goals__name {
  color: var(--gray-400);
  text-decoration: line-through;
}

.goal-detail-sub-goals__check-form {
  margin: 0;
  flex-shrink: 0;
}

.goal-detail-sub-goals__check {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 6px;
  border: 1.5px solid var(--neutral-300);
  background: var(--surface-raised);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  color: var(--text-on-accent);
}

.goal-detail-sub-goals__item.is-done .goal-detail-sub-goals__check {
  background: #10b981;
  border-color: #10b981;
}

.goal-detail-sub-goals__label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.goal-detail-sub-goals__name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.goal-detail-sub-goals__due {
  font-size: 0.75rem;
  color: var(--gray-400);
  flex-shrink: 0;
}

.goal-detail-sub-goals__due.is-overdue {
  color: #dc2626;
  font-weight: 600;
}

.goal-detail-sub-goals__badges {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

.goal-detail-sub-goals__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.goal-detail-sub-goals__dot--high {
  background: #ef4444;
}

.goal-detail-sub-goals__dot--low {
  background: #9ca3af;
}

.goal-detail-sub-goals__chip {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--secondary);
  background: var(--accent-subtle);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
}

.goal-detail-sub-goals__remove {
  border: none;
  background: transparent;
  color: var(--neutral-300);
  padding: 0.2rem;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.12s, color 0.12s;
}

.goal-detail-sub-goals__item:hover .goal-detail-sub-goals__remove,
.goal-detail-sub-goals__remove:focus-visible {
  opacity: 1;
}

.goal-detail-sub-goals__remove:hover {
  color: #dc2626;
}

@media (hover: none) {
  .goal-detail-sub-goals__remove {
    opacity: 0.55;
  }
}

.goal-detail-sub-goals__item--next .goal-detail-sub-goals__row {
  border-color: #93b8f0;
  box-shadow: 0 0 0 1px rgba(0, 82, 204, 0.08);
}

.goal-detail-sub-goals__row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: var(--surface-raised);
}

.goal-detail-sub-goals__check-form {
  margin: 0;
  display: contents;
}

.goal-detail-sub-goals__check-btn {
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 6px;
  border: 2px solid #d1d5db;
  background: var(--surface-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
}

.goal-detail-sub-goals__check-btn--completed {
  background: #10b981;
  border-color: #10b981;
}

.goal-detail-sub-goals__check-btn--in_progress {
  border-color: #0052cc;
  background: #e8f4fd;
}

.goal-detail-sub-goals__name--done {
  text-decoration: line-through;
  color: var(--gray-400);
}

.goal-detail-sub-goals__desc {
  font-size: 0.8125rem;
  color: var(--text-subtle);
  line-height: 1.4;
}

.goal-detail-sub-goals__priority {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}

.goal-detail-sub-goals__priority--high {
  background: #fee2e2;
  color: #b91c1c;
}

.goal-detail-sub-goals__priority--medium {
  background: #fef3c7;
  color: #b45309;
}

.goal-detail-sub-goals__priority--low {
  background: #f3f4f6;
  color: var(--text-subtle);
}

.goal-detail-sub-goals__tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0052cc;
  background: #f0f7ff;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
}

.goal-detail-sub-goals__delete {
  border: none;
  background: transparent;
  color: var(--gray-400);
  padding: 0.25rem;
  cursor: pointer;
  border-radius: 6px;
}

.goal-detail-sub-goals__delete:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.goal-detail-sub-goals__summary {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.goal-detail-sub-goals__summary-label {
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

.goal-detail-sub-goals__empty {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-subtle);
  font-size: 0.875rem;
}

.goal-detail-sub-goals__empty-btn {
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid #c5d9f0;
  border-radius: 8px;
  background: #f0f7ff;
  color: #0052cc;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}

.goal-detail-sub-goals__empty-btn:hover {
  background: #e0efff;
}

.goal-detail-add-sub-goal-cta {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid #e8f4f8;
}

.goal-detail-add-sub-goal-cta__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0052cc;
  text-decoration: none;
}

.goal-detail-add-sub-goal-cta__link:hover {
  text-decoration: underline;
}

.goal-detail-parent-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #f0f7ff 0%, #fff 100%);
  border: 1px solid #c5d9f0;
  border-radius: 10px;
}

.goal-detail-parent-banner__icon {
  color: #0052cc;
  flex-shrink: 0;
}

.goal-detail-parent-banner__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.goal-detail-parent-banner__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
}

.goal-detail-parent-banner__link {
  font-weight: 600;
  color: #0052cc;
  text-decoration: none;
}

.goal-detail-parent-banner__link:hover {
  text-decoration: underline;
}

.goal-detail-parent-banner__progress {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.goal-detail-parent-banner__view {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0052cc;
  text-decoration: none;
  flex-shrink: 0;
}

.goal-detail-parent-banner__view:hover {
  text-decoration: underline;
}

/* Sub-goal chip on goals index card */
.goals-card-sub-goals-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: #e8f4fd;
  color: #0052cc;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.goals-card-sub-goals-chip__icon {
  color: #0052cc;
}

.goals-card--has-sub-goals .goals-card-desc {
  color: #0052cc;
  font-weight: 500;
}

/* New goal — sub-goal context banner */
.new-goal-sub-goal-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: #f0f7ff;
  border: 1px solid #c5d9f0;
  border-radius: 10px;
}

.new-goal-sub-goal-banner__icon {
  color: #0052cc;
  flex-shrink: 0;
}

.new-goal-sub-goal-banner__content {
  flex: 1;
  min-width: 0;
}

.new-goal-sub-goal-banner__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
}

.new-goal-sub-goal-banner__parent {
  display: block;
  font-size: 1rem;
  color: var(--text-heading);
  margin: 0.15rem 0;
}

.new-goal-sub-goal-banner__hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

.new-goal-sub-goal-banner__link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0052cc;
  text-decoration: none;
  flex-shrink: 0;
  align-self: center;
}

.new-goal-sub-goal-banner__link:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .goal-detail-grid--with-sub-goals {
    grid-template-areas:
      "overview"
      "consistency"
      "right"
      "reflection"
      "subgoals";
  }

  .goal-detail-page--one-time .goal-detail-grid--with-sub-goals {
    grid-template-areas:
      "overview"
      "right"
      "reflection"
      "subgoals";
  }

  .goal-detail-sub-goals__header {
    flex-direction: column;
  }

  .goal-detail-parent-banner {
    flex-wrap: wrap;
  }
}

/* Milestone Styles */
.goals-show-milestones-card {
  grid-column: 1 / -1;
  /* Full width */
  margin-bottom: 1.5rem;
}

.goals-show-milestones-progress {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.goals-show-milestones-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.goals-show-milestones-progress-percentage {
  font-weight: 600;
  color: var(--text-heading);
}

.goals-show-milestones-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.goals-show-milestone-item {
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius);
  background: var(--white);
  transition: all 0.2s;
}

.goals-show-milestone-item.locked {
  opacity: 0.6;
  background: #f9fafb;
}

.goals-show-milestone-item.completed {
  border-color: var(--success);
  background: #f0fdf4;
}

.goals-show-milestone-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.goals-show-milestone-number {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.goals-show-milestone-item.locked .goals-show-milestone-number {
  background: #9ca3af;
}

.goals-show-milestone-item.completed .goals-show-milestone-number {
  background: var(--success);
}

.goals-show-milestone-info {
  flex-grow: 1;
}

.goals-show-milestone-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 0.25rem 0;
}

.goals-show-milestone-description {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin: 0 0 0.5rem 0;
}

.goals-show-milestone-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--gray-500);
}

.goals-show-milestone-status {
  flex-shrink: 0;
}

.goals-show-milestone-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.goals-show-milestone-badge.completed {
  background: var(--success);
  color: var(--white);
}

.goals-show-milestone-badge.unlocked {
  background: var(--primary);
  color: var(--white);
}

.goals-show-milestone-badge.locked {
  background: #9ca3af;
  color: var(--white);
}

.goals-show-milestone-progress {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.goals-show-milestone-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.goals-show-milestone-log-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.goals-show-milestone-log-form {
  margin-top: 0.5rem;
}

/* Milestone Form Styles (New Goal Page) */
.new-goal-milestone-item {
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  background: #f9fafb;
  margin-bottom: 1rem;
}

.new-goal-milestone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.new-goal-milestone-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

.new-goal-milestone-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.new-goal-milestone-remove:hover {
  background: #fee2e2;
}

.new-goal-add-milestone-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--white);
  border: 2px dashed #d1d5db;
  border-radius: var(--radius);
  color: var(--gray-700);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.new-goal-add-milestone-btn:hover {
  border-color: var(--text-heading);
  color: var(--text-heading);
  background: #f0f9ff;
}

/* Goal Detail Dashboard */
.goal-detail-page {
  width: 100%;
  max-width: 100%;
  padding-bottom: 2rem;
  box-sizing: border-box;
}

.goal-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.goal-detail-breadcrumb {
  font-size: 0.875rem;
  color: var(--text-subtle);
  margin-bottom: 0;
  font-family: 'DM Sans', sans-serif;
  min-width: 0;
  flex: 1;
}

.goal-detail-breadcrumb a {
  color: #0052cc;
  text-decoration: none;
}

.goal-detail-breadcrumb a:hover {
  text-decoration: underline;
}

.goal-detail-breadcrumb-sep {
  margin: 0 0.35rem;
  color: var(--gray-400);
}

.goal-detail-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.goal-detail-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
  color: var(--text-heading);
  cursor: pointer;
  text-decoration: none;
}

.goal-detail-action-btn--danger:hover {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.goal-detail-dot {
  margin: 0 0.25rem;
  color: var(--gray-400);
}

.goal-detail-breadcrumb-current {
  color: var(--text-heading);
  font-weight: 500;
}

.goal-detail-grid {
  display: grid;
  width: 100%;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 340px);
  grid-template-areas:
    "overview right"
    "consistency right"
    "reflection reflection";
  align-items: stretch;
}

.goal-detail-cell {
  min-width: 0;
}

.goal-detail-cell--overview {
  grid-area: overview;
}

.goal-detail-cell--right {
  grid-area: right;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.goal-detail-right-primary {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 0 0 auto;
}

.goal-detail-cell--right .goal-detail-logs {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.goal-detail-cell--right .goal-detail-logs .goal-detail-card-header {
  flex-shrink: 0;
}

.goal-detail-cell--right .goal-detail-log-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.goal-detail-cell--consistency {
  grid-area: consistency;
}

.goal-detail-cell--reflection {
  grid-area: reflection;
}

.goal-detail-cell .goal-detail-card {
  height: auto;
  display: flex;
  flex-direction: column;
}

.goal-detail-icon {
  flex-shrink: 0;
  color: #0052cc;
}

.goal-detail-icon--flame {
  color: #ff6b35;
}

.goal-detail-icon--sparkles {
  color: #0052cc;
}

.goal-detail-icon--calendar {
  color: #0052cc;
}

.goal-detail-card-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.goal-detail-tag--type {
  background: #f0fdf4;
  color: #166534;
}

.goal-detail-desc-icon {
  vertical-align: middle;
  margin-right: 0.25rem;
  color: #0052cc;
}

.goal-detail-completed-banner {
  margin: 0;
  padding: 0.75rem 1rem;
  background: #ecfdf5;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #166534;
  text-align: center;
}

.goal-detail-consistency-hint {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin: 0 0 0.75rem;
  line-height: 1.45;
}

.goal-detail-checkin-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.goal-detail-checkin-time {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-subtle);
  min-width: 4.5rem;
}

.goal-detail-checkin-actions {
  display: flex;
  flex: 1;
  gap: 0.5rem;
  min-width: 0;
}

.goal-detail-checkin-done {
  font-size: 0.875rem;
  color: #166534;
  margin: 0;
}

.goal-detail-log-meta {
  color: var(--text-subtle);
}

.goal-detail-page--one-time .goal-detail-grid {
  grid-template-areas:
    "overview right"
    "reflection reflection";
}

@media (max-width: 900px) {
  .goal-detail-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "overview"
      "consistency"
      "right"
      "reflection";
  }

  .goal-detail-page--one-time .goal-detail-grid {
    grid-template-areas:
      "overview"
      "right"
      "reflection";
  }

  .goal-detail-cell--right .goal-detail-logs {
    min-height: 200px;
  }

  .goal-detail-overview-title {
    font-size: 1.25rem;
  }

  .goal-detail-overview-head {
    flex-direction: column;
  }

  .goal-detail-overview-pct-block {
    text-align: left;
  }

  .goal-detail-overview-pct-label {
    margin-left: 0;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .goal-detail-checkin-buttons,
  .goal-detail-checkin-actions {
    flex-direction: column;
  }

  .goal-detail-number-row {
    flex-wrap: wrap;
  }

  .goal-detail-header {
    flex-direction: column;
    align-items: stretch;
  }

  .goal-detail-header-actions {
    justify-content: flex-end;
  }
}

.goal-detail-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(3, 16, 26, 0.04);
  box-sizing: border-box;
}

.goal-detail-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.goal-detail-card-header--spread {
  justify-content: space-between;
}

.goal-detail-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
  font-family: 'DM Sans', sans-serif;
}

.goal-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.goal-detail-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.goal-detail-tag--category {
  background: #e8f4fd;
  color: #0052cc;
}

.goal-detail-tag--category.goal-detail-tag--wellness {
  background: #d1fae5;
  color: #059669;
}

.goal-detail-tag--category.goal-detail-tag--productivity {
  background: #dbeafe;
  color: #2563eb;
}

.goal-detail-tag--frequency {
  background: #f3f4f6;
  color: var(--text-label);
}

.goal-detail-overview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.goal-detail-overview-head-left {
  flex: 1;
  min-width: 0;
}

.goal-detail-overview-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.5rem 0 0.35rem;
  color: var(--text-heading);
  line-height: 1.2;
}

.goal-detail-overview-desc {
  font-size: 0.9rem;
  color: var(--text-subtle);
  margin: 0;
  line-height: 1.5;
}

.goal-detail-overview-pct-block {
  text-align: right;
  flex-shrink: 0;
}

.goal-detail-overview-pct-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: #0052cc;
  line-height: 1;
}

.goal-detail-overview-pct-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-subtle);
  margin-top: 0.25rem;
  max-width: 5.5rem;
  margin-left: auto;
  line-height: 1.3;
}

.goal-detail-overview-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  width: 100%;
}

.goal-detail-ring-wrap {
  position: relative;
  width: 160px;
  height: 160px;
}

.goal-detail-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
}

.goal-detail-ring-count {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading);
}

.goal-detail-ring-label {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.goal-detail-checkin {
  background: var(--accent-subtle);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-top: 0.5rem;
}

.goal-detail-checkin-question {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--text-heading);
}

.goal-detail-checkin-hint {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin: 0 0 0.85rem;
  line-height: 1.4;
}

.goal-detail-checkin-buttons {
  display: flex;
  gap: 0.75rem;
}

.goal-detail-checkin-form {
  flex: 1;
}

.goal-detail-btn {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  font-family: 'DM Sans', sans-serif;
}

.goal-detail-btn--yes {
  background: #0052cc;
  color: #fff;
}

.goal-detail-btn--yes:hover {
  background: #0041a3;
}

.goal-detail-btn--no {
  background: var(--surface-raised);
  color: var(--text-heading);
  border: 1px solid var(--border-default);
}

.goal-detail-number-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.goal-detail-number-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

/* Streaks card */
.goal-detail-streaks {
  position: relative;
  overflow: hidden;
}

.goal-detail-streaks-deco {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  opacity: 0.12;
  pointer-events: none;
}

.goal-detail-streaks-deco-icon {
  color: #ff6b35;
}

.goal-detail-icon--bolt {
  color: #14b8a6;
}

.goal-detail-streaks-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.goal-detail-streaks-title-row .goal-detail-card-title {
  margin: 0;
}

.goal-detail-streak-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.goal-detail-streak-stat-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-subtle);
  margin-bottom: 0.35rem;
}

.goal-detail-streak-stat-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
}

.goal-detail-streaks--active .goal-detail-streak-stat-value {
  color: var(--text-heading);
}

.goal-detail-streak-empty {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-subtle);
}

/* AI Insights card */
.goal-detail-insights {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, #7c3aed 8%, var(--surface-raised)) 0%, color-mix(in srgb, #0052cc 8%, var(--surface-raised)) 100%);
  border-color: var(--border-default);
}

.goal-detail-insights-deco {
  position: absolute;
  bottom: -0.25rem;
  right: 0.5rem;
  opacity: 0.15;
  pointer-events: none;
}

.goal-detail-insights-deco-icon {
  color: #0052cc;
}

.goal-detail-insights .goal-detail-card-header {
  margin-bottom: 0.65rem;
}

.goal-detail-insights-summary {
  font-size: 0.9rem;
  color: var(--text-heading);
  line-height: 1.6;
  margin: 0 0 0.75rem;
  font-style: italic;
  position: relative;
  z-index: 1;
}

.goal-detail-insights-detail {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin: 0 0 0.75rem;
}

.goal-detail-insights-link,
.goal-detail-link {
  position: relative;
  z-index: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0052cc;
  text-decoration: none;
}

.goal-detail-insights-link:hover,
.goal-detail-link:hover {
  text-decoration: underline;
}

.goal-detail-filter {
  font-size: 0.75rem;
  color: var(--text-subtle);
  background: var(--surface-sunken);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}

.goal-detail-heatmap-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 0.65rem;
  color: var(--gray-400);
  margin-bottom: 0.35rem;
  text-align: center;
}

.goal-detail-heatmap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0.75rem;
  width: 100%;
}

.goal-detail-heatmap-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.goal-detail-heatmap-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  min-width: 0;
  min-height: 24px;
  width: 100%;
  display: block;
}

.goal-detail-heatmap-cell--completed {
  background: #0052cc;
}

.goal-detail-heatmap-cell--missed {
  background: #e5e7eb;
}

.goal-detail-heatmap-cell--skipped {
  background: #e8f4fd;
}

.goal-detail-heatmap-cell--pending {
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
}

.goal-detail-heatmap-cell--outside,
.goal-detail-heatmap-cell--empty {
  background: transparent;
}

.goal-detail-heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.7rem;
  color: var(--text-subtle);
}

.goal-detail-heatmap-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 0.25rem;
  font-style: normal;
  vertical-align: middle;
}

.goal-detail-consistency {
  padding: 1rem 1.25rem;
}

.goal-detail-consistency .goal-detail-card-header {
  margin-bottom: 0.75rem;
}

.goal-detail-consistency .goal-detail-heatmap-labels {
  margin-bottom: 0.35rem;
  font-size: 0.65rem;
  gap: 4px;
}

.goal-detail-consistency .goal-detail-heatmap {
  gap: 5px;
  margin-bottom: 0.25rem;
}

.goal-detail-consistency .goal-detail-heatmap-week {
  gap: 5px;
}

.goal-detail-consistency .goal-detail-heatmap-cell {
  aspect-ratio: auto;
  min-height: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 3px;
  overflow: hidden;
}

.goal-detail-consistency .goal-detail-heatmap-cell-value {
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-detail-consistency .goal-detail-heatmap-cell--completed .goal-detail-heatmap-cell-value {
  color: #ffffff;
}

.goal-detail-consistency .goal-detail-heatmap-cell--missed .goal-detail-heatmap-cell-value {
  color: var(--text-label);
}

.goal-detail-consistency .goal-detail-heatmap-cell--pending .goal-detail-heatmap-cell-value {
  color: var(--text-subtle);
}

.goal-detail-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.goal-detail-log-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-default);
  font-size: 0.85rem;
}

.goal-detail-log-text {
  flex: 1;
  min-width: 0;
}

.goal-detail-log-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-heading);
  flex-shrink: 0;
}

.goal-detail-log-value--missed {
  color: var(--gray-400);
  font-weight: 500;
}

.goal-detail-log-item:last-child {
  border-bottom: none;
}

.goal-detail-log-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.goal-detail-log-icon--done {
  background: #dcfce7;
  color: #166534;
}

.goal-detail-log-icon--done .goal-detail-icon {
  color: #166534;
}

.goal-detail-log-icon--missed {
  background: #f3f4f6;
  color: var(--text-subtle);
}

.goal-detail-log-icon--missed .goal-detail-icon {
  color: var(--text-subtle);
}

.goal-detail-reflection-box {
  background: var(--surface-sunken);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.goal-detail-reflection-meta {
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin: 0 0 0.35rem;
}

.goal-detail-reflection-content {
  font-size: 0.9rem;
  color: var(--text-heading);
  line-height: 1.6;
  margin: 0;
}

.goal-detail-muted {
  font-size: 0.875rem;
  color: var(--text-subtle);
  margin: 0;
}

.goal-detail-legacy {
  margin-top: 1.5rem;
  border: 1px solid #e8ecf0;
  border-radius: 12px;
  background: var(--surface-raised);
  overflow: hidden;
}

.goal-detail-legacy-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-heading);
  cursor: pointer;
  list-style: none;
  font-family: 'DM Sans', sans-serif;
}

.goal-detail-legacy-summary::-webkit-details-marker {
  display: none;
}

.goal-detail-legacy-body {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid #f0f2f5;
}

.goal-detail-legacy-body .goals-show-grid {
  margin-top: 0;
}

.missions-page .missions-card .user-dashboard-card-body {
  flex: none;
}

.missions-card .missions-subtext,
.missions-inline-meta {
  font-size: 0.875rem;
  color: var(--text-subtle);
  margin: 0;
}

.missions-points-badge {
  background: #e8f4fd;
  color: #0094e9;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

.missions-progress {
  padding: 0 1.25rem 1rem;
}

.missions-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-subtle);
  margin-bottom: 0.5rem;
}

.missions-progress-bar {
  height: 6px;
  background: var(--surface-sunken);
  border-radius: 999px;
  overflow: hidden;
}

.missions-progress-fill {
  height: 100%;
  background: #0094e9;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.missions-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border-default);
}

.missions-row:last-child {
  border-bottom: none;
}

.missions-row--completed_not_claimed {
  background: var(--accent-subtle);
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: 8px;
}

.missions-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.missions-check--done {
  background: #0094e9;
  border-color: #0094e9;
  color: #fff;
  font-size: 0.75rem;
}

.missions-row-title {
  font-weight: 600;
  color: var(--text-heading);
  display: block;
}

.missions-row-title--done {
  text-decoration: line-through;
  color: var(--gray-400);
}

.missions-row-desc {
  font-size: 0.8125rem;
  color: var(--text-subtle);
  display: block;
}

.missions-row-body {
  flex: 1;
  min-width: 0;
}

.missions-row-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.missions-points {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0094e9;
}

.missions-btn {
  font-size: 0.8125rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.missions-btn--primary,
.missions-btn--claim {
  background: #0094e9;
  color: #fff;
}

.missions-btn--ghost {
  background: var(--surface-sunken);
  color: var(--text-heading);
}

.missions-empty,
.missions-success {
  font-size: 0.9375rem;
  color: var(--text-subtle);
  margin: 0;
}

.missions-streak {
  font-size: 0.875rem;
  color: #0094e9;
  margin: 0.25rem 0 0;
  font-weight: 600;
}

.missions-row-progress {
  font-size: 0.8125rem;
  color: var(--text-subtle);
  display: block;
  margin-top: 0.25rem;
}

.missions-row-progress-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  margin-top: 0.35rem;
  overflow: hidden;
  max-width: 8rem;
}

.missions-row-progress-fill {
  height: 100%;
  background: #0094e9;
  border-radius: 2px;
  transition: width 0.2s ease;
}

.missions-check--expired {
  color: var(--gray-400);
  font-weight: 600;
}

.missions-status-text--expired {
  color: var(--gray-400);
  font-size: 0.8125rem;
}

.missions-detail-progress {
  font-size: 0.9375rem;
  color: var(--text-label);
  margin: 0.5rem 0;
}

/* Missions — card layout & hero */
.missions-page {
  position: relative;
  width: 100%;
}

.missions-page-header.user-dashboard-card-header {
  align-items: flex-start;
}

.missions-page-header .user-dashboard-card-title-wrapper {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.missions-page-header .user-dashboard-card-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.missions-page .missions-subtext {
  margin: 0;
}

.missions-card--full {
  width: 100%;
  max-width: none;
}

.missions-page .user-dashboard-card.missions-card--full {
  width: 100%;
}

.missions-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}


.missions-list .missions-card {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem 1.125rem;
  border-radius: 12px;
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.missions-list .missions-card-body {
  flex: 1;
  min-width: 0;
}

.missions-list .missions-card--claimable {
  border-color: #fbbf24;
  background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.15);
}

.missions-list .missions-card--claimed {
  opacity: 0.75;
  background: var(--surface-sunken);
}

.missions-list .missions-card--expired {
  opacity: 0.6;
}

.missions-list .missions-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
  background: color-mix(in srgb, var(--mission-accent, #0094e9) 12%, var(--surface-raised));
  color: var(--mission-accent, #0094e9);
}

.missions-list .missions-card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.25rem;
}

.missions-list .missions-type-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mission-accent, #0094e9);
}

.missions-list .missions-card-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
}

.missions-list .missions-card-badge--claim {
  background: #fef3c7;
  color: #b45309;
}

.missions-list .missions-card-badge--claimed {
  background: #d1fae5;
  color: #047857;
}

.missions-list .missions-card-badge--expired {
  background: #f3f4f6;
  color: var(--text-subtle);
}

.missions-list .missions-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
}

.missions-list .missions-card-desc {
  font-size: 0.8125rem;
  color: var(--text-subtle);
  margin: 0.25rem 0 0;
}

.missions-list .missions-card-progress {
  margin-top: 0.5rem;
}

.missions-list .missions-card-progress-label {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.missions-list .missions-card-progress-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  margin-top: 0.25rem;
  max-width: 10rem;
  overflow: hidden;
}

.missions-list .missions-card-progress-fill {
  height: 100%;
  background: var(--mission-accent, #0094e9);
  border-radius: 2px;
}

.missions-list .missions-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.5rem;
  flex-shrink: 0;
  align-self: center;
}

.missions-list .missions-card-points {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0094e9;
}

/* Dashboard: compact mission rows (after .missions-list rules for cascade) */
.missions-list.missions-list--compact {
  display: flex;
  flex-direction: column;
  gap: var(--dash-gap, 0.75rem);
  margin-top: var(--dash-gap, 0.75rem);
}

.missions-list.missions-list--compact .missions-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "icon body actions";
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0.85rem;
}

.missions-list.missions-list--compact .missions-card-icon {
  grid-area: icon;
  width: 40px;
  height: 40px;
}

.missions-list.missions-list--compact .missions-card-body {
  grid-area: body;
  flex: none;
  min-width: 0;
}

.missions-list.missions-list--compact .missions-card-header {
  margin-bottom: 0.15rem;
}

.missions-list.missions-list--compact .missions-card-title {
  font-size: 0.9375rem;
  line-height: 1.3;
}

.missions-list.missions-list--compact .missions-card-desc {
  font-size: 0.75rem;
  margin-top: 0.1rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.missions-list.missions-list--compact .missions-card-actions {
  grid-area: actions;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  align-self: center;
}

.missions-list.missions-list--compact .missions-card-points {
  font-size: 0.8125rem;
}

.missions-list.missions-list--compact .missions-card--claimed {
  opacity: 0.85;
}

.missions-hero {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 0 1.25rem;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 0.5rem;
}

.missions-hero-ring {
  width: 100px;
  height: 100px;
  transform: rotate(-90deg);
}

.missions-hero-ring-bg {
  fill: none;
  stroke: #e5e7eb;
  stroke-width: 8;
}

.missions-hero-ring-fill {
  fill: none;
  stroke: #0094e9;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.4s ease;
}

.missions-hero-progress {
  position: relative;
  flex-shrink: 0;
}

.missions-hero-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.missions-hero-percent {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading);
}

.missions-hero-sublabel {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.missions-hero-streak {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #ea580c;
  margin: 0 0 0.25rem;
}

.missions-hero-points {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0;
}

.missions-hero-points span {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-subtle);
}

.missions-hero-meta {
  font-size: 0.875rem;
  color: var(--text-subtle);
  margin: 0.25rem 0 0;
}

.missions-streak--inline {
  margin: 0 0 0.5rem;
}

.missions-page .missions-empty-state {
  text-align: center;
  padding: 2rem 1rem;
}

.missions-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.missions-empty-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.missions-empty-text {
  color: var(--text-subtle);
  margin: 0 0 1.25rem;
}

.missions-empty-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.missions-success-state {
  text-align: center;
  padding: 1.25rem;
  margin-top: 1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--success) 12%, var(--surface-raised)) 0%, color-mix(in srgb, var(--secondary) 10%, var(--surface-raised)) 100%);
  border: 1px solid color-mix(in srgb, var(--success) 35%, var(--border-default));
}

.missions-success-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.missions-success-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--text-heading);
}

.missions-success-text {
  color: var(--text-subtle);
  margin: 0;
  font-size: 0.9375rem;
}

.missions-history {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-default);
}

.missions-history-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--text-label);
}

.missions-history-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.missions-history-day {
  text-align: center;
}

.missions-history-label {
  font-size: 0.6875rem;
  color: var(--text-subtle);
  display: block;
  margin-bottom: 0.35rem;
}

.missions-history-bar {
  height: 48px;
  background: #f3f4f6;
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.missions-history-bar-fill {
  width: 100%;
  background: #0094e9;
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  transition: height 0.3s ease;
}

.missions-history-bar--empty {
  background: #f9fafb;
  min-height: 48px;
}

.missions-history-count {
  font-size: 0.625rem;
  color: var(--gray-400);
  display: block;
  margin-top: 0.25rem;
}

.missions-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #03101a;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.missions-toast--visible {
  transform: translateX(-50%) translateY(0);
}

.missions-confetti {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: radial-gradient(circle at 20% 30%, rgba(0, 148, 233, 0.2) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.2) 0%, transparent 40%);
  opacity: 0;
  animation: missions-confetti-fade 1.2s ease forwards;
}

@keyframes missions-confetti-fade {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}

/* Admin missions */
.admin-missions-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-missions-stat-card {
  background: var(--surface-raised);
  border: 1px solid #f0f1f3;
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.admin-missions-stat-card--highlight {
  border-color: #bae6fd;
  background: #f0f9ff;
}

.admin-missions-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
}

.admin-missions-stat-label {
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

.admin-missions-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.admin-missions-tab {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-subtle);
  text-decoration: none;
  background: #f9fafb;
}

.admin-missions-tab.active {
  background: #0094e9;
  color: #fff;
}

.admin-missions-filters {
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
}

.admin-missions-filters .admin-search-box {
  flex: 1 1 auto;
  min-width: 200px;
  max-width: none;
}

.admin-missions-filters .admin-search-icon,
.admin-missions-filters .admin-search-box svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  z-index: 2;
  pointer-events: none;
  flex-shrink: 0;
}

.admin-missions-filters .admin-search-input {
  min-height: 46px;
  box-sizing: border-box;
}

.admin-missions-filter-form {
  display: flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  gap: 0.5rem;
  align-items: center;
}

.admin-missions-filter-form .admin-form-input.admin-missions-filter-select,
.admin-missions-filter-form .admin-form-input.admin-missions-filter-date {
  width: auto;
  min-width: 130px;
  max-width: 160px;
  padding: 0.75rem;
  font-size: 0.875rem;
  flex-shrink: 0;
  box-sizing: border-box;
  min-height: 46px;
}

@media (max-width: 900px) {
  .admin-missions-filters {
    flex-wrap: wrap;
  }

  .admin-missions-filter-form {
    flex-wrap: wrap;
    width: 100%;
  }
}

.admin-mission-type-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--mission-accent, #6b7280) 15%, white);
  color: var(--mission-accent, #374151);
}

.admin-status-tag--template {
  background: #ede9fe;
  color: #6d28d9;
}

.admin-mission-points {
  font-weight: 600;
  color: #0094e9;
}

.admin-mission-recurrence-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: #ede9fe;
  color: #5b21b6;
}

.admin-missions-table th:nth-child(1),
.admin-missions-table td:nth-child(1) {
  width: 30%;
  min-width: 12rem;
  white-space: normal;
}

.admin-missions-table th:nth-child(2),
.admin-missions-table td:nth-child(2) {
  width: 10%;
}

.admin-missions-table th:nth-child(3),
.admin-missions-table td:nth-child(3) {
  width: 8%;
}

.admin-missions-table th:nth-child(4),
.admin-missions-table td:nth-child(4) {
  width: 14%;
}

.admin-missions-table th:nth-child(5),
.admin-missions-table td:nth-child(5) {
  width: 10%;
}

.admin-missions-table th:last-child,
.admin-missions-table td:last-child {
  width: 14rem;
  white-space: normal;
}

.admin-missions-table .admin-template-actions {
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  justify-content: flex-start;
}

.admin-missions-table .admin-action-btn {
  width: auto;
  height: auto;
  min-height: 0;
  padding: 0.125rem 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #0094e9;
  background: transparent;
  border-radius: 0;
}

.admin-missions-table .admin-action-btn:hover {
  background: transparent;
  color: #0077ba;
  text-decoration: underline;
}

.admin-missions-table .admin-action-btn.admin-edit-btn {
  color: #0094e9;
}

.admin-missions-table .admin-action-btn.admin-delete-btn,
.admin-missions-table .admin-action-btn.admin-action-btn--danger {
  color: #dc2626;
  background: transparent;
  border: none;
}

.admin-missions-table .admin-action-btn.admin-delete-btn:hover,
.admin-missions-table .admin-action-btn.admin-action-btn--danger:hover {
  color: #b91c1c;
  background: transparent;
  text-decoration: underline;
}

.admin-missions-table .admin-action-text {
  font-size: 0.8125rem;
}

.admin-form-hint {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-subtle);
  margin-top: 0.25rem;
}

.admin-form-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 1.25rem 0;
}

.admin-form-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0 0 0.75rem;
}

.admin-mission-detail-card {
  background: var(--surface-raised);
  border: 1px solid #f0f1f3;
  border-radius: 12px;
  padding: 1.5rem;
}

.admin-mission-detail-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.5rem;
  margin: 0;
}

.admin-mission-detail-list dt {
  font-weight: 600;
  color: var(--text-subtle);
  font-size: 0.875rem;
}

.admin-mission-detail-list dd {
  margin: 0;
  color: var(--text-heading);
}

.admin-mission-show-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1.25rem;
}

.admin-back-link {
  display: inline-block;
  font-size: 0.875rem;
  color: #0094e9;
  margin-bottom: 0.5rem;
  text-decoration: none;
}

.admin-action-text {
  font-size: 0.75rem;
  font-weight: 500;
}

.admin-action-btn--small {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

@media (max-width: 768px) {
  .admin-missions-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .missions-hero {
    flex-direction: column;
    text-align: center;
  }

  .missions-list:not(.missions-list--compact) .missions-card {
    flex-wrap: wrap;
  }

  .missions-list:not(.missions-list--compact) .missions-card-actions {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    align-self: stretch;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f0f1f3;
  }

  .missions-list.missions-list--compact .missions-card {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "icon body"
      "actions actions";
  }

  .missions-list.missions-list--compact .missions-card-actions {
    width: 100%;
    justify-content: space-between;
    margin-top: 0.25rem;
    padding-top: 0.35rem;
    border-top: 1px solid #f0f1f3;
  }

  .missions-history-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.leaderboard-card--preview .leaderboard-reset,
.leaderboard-reset {
  font-size: 0.75rem;
  color: var(--gray-400);
  padding: 0 1.25rem;
  margin: 0 0 0.5rem;
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

.leaderboard-row--you {
  background: #0094e9;
  color: #fff;
  margin: 0 -0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}

.leaderboard-rank {
  width: 1.25rem;
  font-weight: 600;
}

.leaderboard-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.leaderboard-row--you .leaderboard-avatar {
  background: rgba(255, 255, 255, 0.25);
}

.leaderboard-name {
  flex: 1;
  color: var(--text-heading);
}

.leaderboard-score {
  font-weight: 600;
  color: var(--text-heading);
}

.leaderboard-your-rank {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--surface-sunken);
  border-radius: 8px;
  font-size: 0.875rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.leaderboard-privacy-btn {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
  cursor: pointer;
}

.leaderboard-privacy-note {
  font-size: 0.8125rem;
  color: var(--text-subtle);
  padding: 0 1.25rem;
}

.user-dashboard-card-title--nowrap {
  white-space: nowrap;
  flex-shrink: 0;
}

.leaderboard-card--preview .user-dashboard-card-header {
  flex-wrap: nowrap;
  gap: 0.5rem;
}

.leaderboard-card--preview .user-dashboard-card-header-actions {
  flex-shrink: 1;
  min-width: 0;
}

.leaderboard-modal[hidden] {
  display: none;
}

body.leaderboard-modal-open {
  overflow: hidden;
}

.leaderboard-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.leaderboard-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(3, 16, 26, 0.45);
  cursor: pointer;
}

.leaderboard-modal-content {
  position: relative;
  z-index: 1;
  background: var(--surface-raised);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-default);
}

.leaderboard-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 0;
}

.leaderboard-modal-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: -0.01em;
}

.leaderboard-modal-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: #f3f4f6;
  color: var(--text-subtle);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.leaderboard-modal-close:hover {
  background: #e5e7eb;
  color: var(--text-label);
}

.leaderboard-modal-body {
  padding: 1rem 1.25rem 0;
}

.leaderboard-modal-body p {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-label);
}

.leaderboard-modal-body p:last-child {
  margin-bottom: 0;
}

.leaderboard-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 1.25rem;
  border-top: 1px solid #f0f1f3;
  margin-top: 1.25rem;
}

.coaching-preview-card {
  margin-bottom: 0;
}

.coaching-preview-card .coaching-preview-text {
  font-size: 0.9375rem;
  color: var(--text-label);
  margin: 0 0 var(--dash-gap, 0.75rem);
}

.coaching-preview-meta {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin: 0;
}

/* AI Coach page */
.coaching-page {
  width: 100%;
}

.coaching-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  align-items: stretch;
}

@media (max-width: 900px) {
  .coaching-hero-layout {
    grid-template-columns: 1fr;
  }
}

.coaching-hero-card {
  position: relative;
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: 1.75rem 1.75rem 1.5rem;
  min-height: 220px;
  box-shadow: var(--shadow-sm);
}

.coaching-hero-icon {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
}

.coaching-hero-label {
  font-size: 0.8125rem;
  color: var(--gray-400);
  margin: 0 0 0.35rem;
  font-weight: 500;
}

.coaching-hero-title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--text-heading);
  line-height: 1.2;
  padding-right: 3rem;
}

.coaching-hero-text {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-label);
  margin: 0;
  max-width: 52rem;
}

.coaching-actions-panel {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: var(--shadow-sm);
}

.coaching-actions-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--text-heading);
}

.coaching-action-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.coaching-action-list form {
  margin: 0;
  width: 100%;
}

.coaching-action-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--surface-sunken);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.coaching-action-row:hover {
  background: var(--neutral-100);
  border-color: var(--neutral-300);
}

.coaching-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.coaching-action-icon--journal { background: #eef2f6; color: var(--text-subtle); }
.coaching-action-icon--focus { background: #e8f8ee; color: #15803d; }
.coaching-action-icon--rest { background: #e8f4fd; color: #0094e9; }
.coaching-action-icon--goal { background: #fef3e8; color: #c2410c; }
.coaching-action-icon--summary { background: #eef2ff; color: #4338ca; }
.coaching-action-icon--checkin { background: #e8f4fd; color: #0094e9; }
.coaching-action-icon--default { background: #f3f4f6; color: var(--text-subtle); }

.coaching-action-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.coaching-action-copy strong {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-heading);
}

.coaching-action-copy span {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.coaching-action-chevron {
  flex-shrink: 0;
}

.coaching-actions-empty,
.coaching-analytics-empty {
  font-size: 0.875rem;
  color: var(--gray-400);
  margin: 0;
}

.coaching-analytics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
  .coaching-analytics-row {
    grid-template-columns: 1fr;
  }
}

.coaching-analytics-card,
.coaching-recent-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: 1.35rem 1.35rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.coaching-analytics-card h3,
.coaching-recent-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0;
}

.coaching-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.coaching-card-head--trajectory {
  align-items: flex-start;
}

.coaching-analytics-sub {
  font-size: 0.8125rem;
  color: var(--gray-400);
  margin: 0.2rem 0 0;
}

.coaching-info-pill {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-subtle);
  background: var(--surface-sunken);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  white-space: nowrap;
}

.coaching-info-pill:hover {
  background: var(--neutral-100);
}

.coaching-stacked-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  height: 150px;
  padding: 1rem;
  background: var(--surface-sunken);
  border-radius: 12px;
}

.coaching-stacked-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
}

.coaching-stacked-bar {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex: 1;
  width: 100%;
  max-width: 36px;
  min-height: 0;
  background: #a3bffa;
  border-radius: 6px;
  overflow: hidden;
}

.coaching-stacked-fill {
  width: 100%;
  background: #1a365d;
  border-radius: 6px 6px 0 0;
  min-height: 0;
  transition: height 0.2s ease;
}

/* Legacy segment classes (kept for any cached partials) */
.coaching-stacked-segment {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}

.coaching-stacked-segment--productivity {
  background: #1a365d;
}

.coaching-stacked-segment--rest {
  background: #a3bffa;
}

.coaching-stacked-label {
  font-size: 0.6875rem;
  color: var(--gray-400);
}

.coaching-chart-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.coaching-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.coaching-legend-dot--productivity { background: #1a365d; }
.coaching-legend-dot--rest { background: #a3bffa; }

.coaching-chart-placeholder {
  padding: 2rem 1rem;
  background: var(--surface-sunken);
  border-radius: 12px;
  text-align: center;
}

.coaching-line-chart-wrap {
  background: var(--surface-sunken);
  border-radius: 12px;
  padding: 1rem 1rem 0.5rem;
}

.coaching-line-chart {
  width: 100%;
  height: 140px;
  display: block;
}

.coaching-line-area {
  fill: rgba(26, 54, 93, 0.08);
}

.coaching-line-stroke {
  fill: none;
  stroke: #1a365d;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.coaching-line-dot {
  fill: #22c55e;
  stroke: var(--surface-raised);
  stroke-width: 1;
}

.coaching-line-target {
  stroke: var(--neutral-300);
  stroke-width: 0.5;
  stroke-dasharray: 4 3;
}

.coaching-line-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--gray-400);
  margin-top: 0.35rem;
  padding: 0 0.25rem;
}

.coaching-badge {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-subtle);
}

.coaching-badge--on-track {
  background: var(--success-bg);
  color: var(--success);
}

.coaching-recent-card {
  margin-bottom: 0;
}

.coaching-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.coaching-timeline-item {
  display: flex;
  gap: 1rem;
  padding: 0 0 1.25rem;
  position: relative;
}

.coaching-timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: var(--border-default);
}

.coaching-timeline-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-sunken);
  color: var(--text-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
}

.coaching-timeline-icon--habit {
  background: var(--surface-sunken);
  color: var(--text-label);
}

.coaching-timeline-body {
  flex: 1;
  background: var(--surface-sunken);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

.coaching-timeline-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.coaching-timeline-date {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.coaching-timeline-badge {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.coaching-timeline-badge--focus {
  background: var(--surface-sunken);
  color: var(--text-subtle);
}

.coaching-timeline-badge--habit {
  background: var(--accent-subtle);
  color: var(--secondary);
}

.coaching-timeline-badge--default {
  background: var(--surface-sunken);
  color: var(--text-subtle);
}

.coaching-timeline-body p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-label);
}

.coaching-history-link {
  display: block;
  text-align: center;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  color: var(--secondary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.coaching-history-link:hover {
  text-decoration: underline;
}

.coaching-info-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coaching-info-modal[hidden] {
  display: none;
}

.coaching-info-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 16, 26, 0.4);
}

.coaching-info-modal-panel {
  position: relative;
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 400px;
  margin: 1rem;
  box-shadow: var(--shadow-lg);
}

.coaching-info-modal-panel h4 {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  color: var(--text-heading);
}

.coaching-info-modal-panel p {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--text-label);
  line-height: 1.5;
}

.coaching-info-modal-close {
  background: var(--secondary);
  color: var(--text-on-accent);
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.coaching-page--history .coaching-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.coaching-history-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0;
}

.coaching-history-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--secondary);
  text-decoration: none;
}

.coaching-history-back:hover {
  text-decoration: underline;
}

/* Quick log — dashboard card + log modal + error toast (WEB-010) */
.user-dashboard-column > .quick-log {
  width: 100%;
}

.quick-log-card .user-dashboard-card-body {
  gap: 0.65rem;
}

.quick-log-card__hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--gray-600, #6b7280);
  line-height: 1.45;
}

.quick-log-form {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.quick-log-form__row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.quick-log-form__input {
  flex: 1;
  min-width: 0;
  padding: 0.625rem 0.875rem;
  border: 1px solid #e8ecef;
  border-radius: 12px;
  font-size: 0.875rem;
  color: var(--primary, #03101a);
  background: var(--white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.quick-log-form__input::placeholder {
  color: var(--gray-400);
}

.quick-log-form__input:focus {
  outline: none;
  border-color: var(--secondary, #0094e9);
  box-shadow: 0 0 0 3px rgba(0, 148, 233, 0.1);
}

.quick-log-form__submit {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0.625rem 1.125rem;
  background: var(--secondary, #0094e9);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.quick-log-form__submit:hover:not(:disabled) {
  background: #0080c7;
}

.quick-log-form__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.quick-log-form__submit-label {
  transition: opacity 0.15s ease;
}

.quick-log--loading .quick-log-form__submit-label {
  opacity: 0;
}

.quick-log-form__submit-spinner {
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: quick-log-spin 0.65s linear infinite;
}

.quick-log--loading .quick-log-form__submit-spinner {
  display: block !important;
}

@keyframes quick-log-spin {
  to { transform: rotate(360deg); }
}

.quick-log-form__examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.quick-log-form__examples-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-400);
}

.quick-log-form__chip {
  padding: 0.35rem 0.65rem;
  background: var(--surface-sunken);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-label);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.quick-log-form__chip:hover {
  border-color: rgba(0, 148, 233, 0.35);
  background: var(--surface-raised);
  color: var(--secondary, #0094e9);
}

.quick-log-form__alert {
  margin: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  color: #b91c1c;
  background: #fef2f2;
  border-radius: 10px;
  border: 1px solid #fecaca;
}

/* Single log modal — preview → animate → undo */
body.quick-log-log-open {
  overflow: hidden;
}

.quick-log-log-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 16, 26, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1040;
  animation: quick-log-fade-in 0.25s ease;
}

.quick-log-log-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1050;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.quick-log-log-modal--visible {
  opacity: 1;
  pointer-events: auto;
}

.quick-log-log-modal__card {
  position: relative;
  pointer-events: auto;
  width: min(94vw, 460px);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  padding: 2rem 1.75rem 1.5rem;
  box-shadow:
    0 4px 6px rgba(3, 16, 26, 0.04),
    0 24px 60px rgba(3, 16, 26, 0.2);
  text-align: left;
  transform: scale(0.92) translateY(16px);
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.quick-log-log-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.quick-log-log-modal__close:hover {
  background: #e2e8f0;
  color: var(--primary, #03101a);
}

.quick-log-log-modal--visible .quick-log-log-modal__card {
  transform: scale(1) translateY(0);
}

.quick-log-log-modal__card[data-phase="logging"] {
  animation: quick-log-card-pulse 1.2s ease-in-out infinite;
}

@keyframes quick-log-card-pulse {
  0%, 100% { box-shadow: 0 20px 50px rgba(3, 16, 26, 0.2); }
  50% { box-shadow: 0 20px 50px rgba(0, 148, 233, 0.25); }
}

/* Goal card inside log modal (matches goals index card, enlarged) */
.quick-log-goal-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
  padding: 0.25rem 0;
}

.quick-log-goal-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.quick-log-goal-card__header-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.quick-log-goal-card .goals-card-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
}

.quick-log-goal-card .goals-card-streak {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ql-accent, #0052cc);
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.quick-log-goal-card__streak--bump {
  animation: quick-log-streak-bump 0.55s cubic-bezier(0.34, 1.5, 0.64, 1);
}

@keyframes quick-log-streak-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.quick-log-goal-card__sub-goals {
  font-size: 0.625rem;
  font-weight: 700;
  color: #6d28d9;
  background: #ede9fe;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

.quick-log-goal-card__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--neutral-900);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.quick-log-goal-card__desc {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--neutral-500);
  line-height: 1.45;
}

.quick-log-goal-card__logging {
  margin: 0.5rem 0 0;
  padding: 0.65rem 0.85rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--ql-accent, #0094e9);
  background: rgba(0, 148, 233, 0.08);
  border-radius: 10px;
  border: 1px solid rgba(0, 148, 233, 0.15);
}

.quick-log-goal-card__note {
  margin: 0;
  font-size: 0.75rem;
  color: var(--gray-400);
  font-style: italic;
}

.quick-log-goal-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #eef2f6;
}

.quick-log-goal-card .goals-card-ring {
  width: 72px;
  height: 72px;
}

.quick-log-goal-card .goals-card-ring-text {
  font-size: 1rem;
  font-weight: 700;
}

.quick-log-goal-card__ring {
  transition: transform 0.95s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.quick-log-goal-card__ring--animating {
  transform: scale(1.15);
}

.quick-log-goal-card__ring--pulse {
  animation: quick-log-ring-pulse 0.8s ease-in-out infinite;
}

@keyframes quick-log-ring-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.quick-log-goal-card--logging .quick-log-goal-card__ring circle:last-of-type {
  filter: drop-shadow(0 0 6px rgba(0, 82, 204, 0.35));
}

.quick-log-goal-card [data-natural-language-log-target="cardRingProgress"] {
  transition: stroke-dashoffset 0.95s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-log-goal-card__ring-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quick-log-log-modal__ambiguous {
  text-align: left;
  margin-bottom: 0.75rem;
}

.quick-log-log-modal__field {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-600, #6b7280);
}

.quick-log-log-modal__field select,
.quick-log-log-modal__field input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #e8ecef;
  border-radius: 12px;
  font-size: 1rem;
  background: var(--surface-raised);
}

.quick-log-log-modal__pulse {
  margin: 0.75rem 0 0;
  padding: 0.5rem 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-600, #6b7280);
  text-align: center;
  animation: quick-log-pulse-text 1.2s ease-in-out infinite;
}

.quick-log-log-modal__card[data-phase="done"] .quick-log-log-modal__pulse {
  display: none;
}

/* After a successful log, hide the progress ring — "Done" in the ring looked like a second action button. */
.quick-log-log-modal__card[data-phase="done"] .quick-log-goal-card__footer {
  display: none;
}

.quick-log-log-modal__card[data-phase="done"] .quick-log-goal-card__logging {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.22);
  color: #059669;
}

@keyframes quick-log-pulse-text {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.quick-log-log-modal__footer {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #eef2f6;
  animation: quick-log-footer-in 0.35s ease 0.1s both;
}

.quick-log-log-modal__footer-primary {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.quick-log-log-modal__footer-secondary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  align-items: stretch;
}

@keyframes quick-log-footer-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.quick-log-log-modal__undo {
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--surface-raised);
  border: 2px solid #fecaca;
  border-radius: 14px;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #b91c1c;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(185, 28, 28, 0.08);
}

.quick-log-log-modal__undo:hover:not(:disabled) {
  background: #fef2f2;
  transform: translateY(-1px);
}

.quick-log-log-modal__undo:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.quick-log-log-modal__relog {
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--secondary, #0094e9);
  border: none;
  border-radius: 14px;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(0, 148, 233, 0.35);
}

.quick-log-log-modal__relog:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
}

.quick-log-log-modal__relog:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.quick-log-log-modal__goal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  background: var(--surface-raised);
  border: 1.5px solid var(--border-default);
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-body);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.quick-log-log-modal__goal-link:hover {
  border-color: var(--secondary, #0094e9);
  background: rgba(0, 148, 233, 0.06);
}

.quick-log-log-modal__dismiss {
  padding: 0.75rem 1.25rem;
  background: var(--surface-sunken);
  border: none;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-subtle);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.quick-log-log-modal__dismiss:hover {
  color: var(--text-body);
  background: var(--neutral-200);
}

.quick-log-log-modal__dismiss--block {
  width: 100%;
  margin-top: 0.5rem;
}

.quick-log-log-modal__checkin p {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  color: var(--primary, #03101a);
}

.quick-log-log-modal__checkin-link {
  display: block;
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: var(--secondary, #0094e9);
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
}

@keyframes quick-log-check-pop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* Error / notice toast — always on top */
.quick-log-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 2rem));
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: min(94vw, 440px);
  padding: 1rem 1.125rem;
  background: var(--surface-raised);
  color: var(--text-heading);
  border-radius: 16px;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  z-index: 20000;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 16px 40px rgba(220, 38, 38, 0.15);
  opacity: 0;
  visibility: hidden;
  transition:
    transform 0.4s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.3s ease,
    visibility 0.3s;
  pointer-events: auto;
}

.quick-log-toast--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

.quick-log-toast__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: #fef2f2;
  color: #dc2626;
  border-radius: 50%;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1;
}

.quick-log-toast__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.quick-log-toast__title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #dc2626;
}

.quick-log-toast__message {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-label);
}

.quick-log-toast__close {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  background: #f3f4f6;
  color: var(--text-subtle);
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  margin: -0.15rem -0.25rem 0 0;
}

.quick-log-toast__close:hover {
  background: #e5e7eb;
}

@keyframes quick-log-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 480px) {
  .quick-log-form__row {
    flex-direction: column;
  }

  .quick-log-form__submit {
    width: 100%;
    min-width: 0;
  }

  .quick-log-log-modal__footer-secondary {
    grid-template-columns: 1fr;
  }

  .quick-log-log-modal__goal-link {
    width: 100%;
  }

  .quick-log-log-modal__dismiss {
    width: 100%;
  }
}

/* ========== Revamp: utility classes ========== */
.glass-card {
  background: var(--surface-overlay);
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.focus-card {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--neutral-200);
  transition: var(--transition-smooth);
}

.focus-card:hover {
  box-shadow: var(--shadow-md);
}

.btn-track {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  width: 100%;
}

.btn-track:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Track Goal action drawer */
.track-goal-drawer {
  position: fixed;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
  visibility: hidden;
}

.track-goal-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.track-goal-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 16, 26, 0.4);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.track-goal-drawer.is-open .track-goal-drawer__overlay {
  opacity: 1;
}

.track-goal-drawer__panel {
  position: absolute;
  top: 0;
  left: 0;
  width: min(320px, 90vw);
  height: 100%;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.track-goal-drawer.is-open .track-goal-drawer__panel {
  transform: translateX(0);
}

.track-goal-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.track-goal-drawer__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-heading);
}

.track-goal-drawer__close {
  background: var(--neutral-100);
  border: none;
  border-radius: var(--radius-sm);
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.track-goal-drawer__close:hover {
  background: var(--neutral-200);
}

.track-goal-drawer__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.track-goal-drawer__action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--neutral-200);
  text-decoration: none;
  color: var(--text-heading);
  font-weight: 600;
  transition: var(--transition-fast);
}

.track-goal-drawer__action:hover {
  border-color: var(--secondary);
  background: hsl(202, 100%, 97%);
}

.track-goal-drawer__action--primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--text-heading);
}

.track-goal-drawer__action--primary:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: var(--white);
}

.track-goal-drawer__action-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  background: var(--neutral-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.track-goal-drawer__action--primary .track-goal-drawer__action-icon {
  background: rgba(255, 255, 255, 0.15);
}

/* Sidebar active indicator */
.user-sidebar-link {
  position: relative;
}

.user-sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--secondary);
  border-radius: 0 2px 2px 0;
}

.user-sidebar-link .user-sidebar-icon svg,
.user-sidebar-link .user-sidebar-icon svg path {
  transition: var(--transition-fast);
}

.user-add-goal-btn {
  border: none;
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
}

.user-add-goal-btn:hover {
  background: var(--primary-light);
  border-color: transparent;
  color: var(--white);
}

/* Dashboard v2 — goals on top, clear hierarchy */
.dashboard-v2 {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.dashboard-v2__row {
  display: grid;
  gap: 0.875rem;
  align-items: stretch;
}

.dashboard-v2__row--goals-due {
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  align-items: stretch;
}

.dashboard-v2__row--goals-due .dashboard-goals-hero__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-v2__row--quick-log {
  grid-template-columns: 1fr;
}

.dashboard-v2__row--paired {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-v2__cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dashboard-v2__row--paired > .user-dashboard-card,
.dashboard-v2__row--paired > .missions-card,
.dashboard-v2__row--paired > .coaching-preview-card,
.dashboard-v2__row--paired > .leaderboard-card--preview,
.dashboard-v2__row--goals-due .dashboard-goals-hero,
.dashboard-v2__row--goals-due .user-dashboard-card,
.dashboard-v2__row--quick-log .quick-log,
.dashboard-v2__row--quick-log .user-dashboard-card,
.dashboard-v2__row--quick-log .today-capture {
  margin: 0;
  height: 100%;
}

.dashboard-v2__cell--due .user-dashboard-card--due {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dashboard-v2__cell--due .user-dashboard-card--due .user-dashboard-card-body {
  flex: 1;
  min-height: 0;
}

/* Goals hero — top of dashboard */
.dashboard-goals-hero {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: var(--shadow-sm);
}

.dashboard-goals-hero__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.dashboard-goals-hero__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0;
}

.dashboard-goals-hero__subtitle {
  font-size: 0.8125rem;
  color: var(--neutral-500);
  margin: 0.2rem 0 0;
}

.dashboard-goals-hero__link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--secondary);
  text-decoration: none;
}

.dashboard-goals-hero__link--muted {
  color: var(--neutral-500);
  margin-left: 0.75rem;
}

.dashboard-goals-hero__link:hover {
  text-decoration: underline;
}

.dashboard-goals-hero__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.875rem;
}

.dashboard-goals-hero__empty {
  padding: 2rem;
  text-align: center;
  color: var(--neutral-500);
  background: var(--neutral-50);
  border-radius: var(--radius-md);
}

/* Compact header */
.user-dashboard-focus-header--compact {
  margin-bottom: 0.25rem;
}

.user-dashboard-focus-header--compact .user-dashboard-greeting {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1.5rem;
}

.user-dashboard-greeting__main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
}

.user-dashboard-focus-header--compact .user-dashboard-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0;
}

.user-dashboard-focus-header--compact .user-dashboard-date {
  font-size: 0.875rem;
  color: var(--neutral-500);
  margin: 0;
}

.user-dashboard-focus-header--compact .user-dashboard-quote-ticker {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--neutral-500);
  font-style: italic;
  max-width: 320px;
  text-align: right;
}

/* Compact widget cards */
.user-dashboard-card--widget {
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
}

.user-dashboard-card--widget .user-dashboard-card-header {
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.user-dashboard-card--widget .user-dashboard-card-body {
  flex: 1;
  min-height: 0;
}

.user-dashboard-card--widget .user-dashboard-card-title {
  font-size: 0.9375rem;
}

.user-dashboard-card--widget .coaching-preview-text,
.user-dashboard-card--widget .user-dashboard-reflection-text {
  font-size: 0.8125rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.user-dashboard-card--due .due-today-checklist {
  max-height: 200px;
  overflow-y: auto;
}

.dashboard-v2__row--paired .leaderboard-list:not(.leaderboard-list--preview) {
  max-height: 200px;
  overflow-y: auto;
}

.dashboard-v2 .missions-card.user-dashboard-card--widget .missions-list--compact {
  margin-top: 0.5rem;
}

/* Dashboard only — match sessions/deadlines inner cards, not full missions page */
.user-dashboard-page .dashboard-v2 .missions-list--compact .missions-card {
  padding: 0.5rem 0.65rem;
  gap: 0.5rem 0.65rem;
}

.dashboard-v2 .user-dashboard-sessions-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dashboard-v2 .user-dashboard-deadline-card {
  padding: 0.5rem 0.65rem;
}

.dashboard-v2__row--quick-log .quick-log-card {
  min-height: 100%;
}

/* Due today checklist */
.due-today-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.due-today-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--neutral-200);
  background: var(--white);
  transition: var(--transition-fast);
}

.due-today-item:hover {
  border-color: var(--secondary);
  box-shadow: var(--shadow-sm);
}

.due-today-item__link {
  flex: 1;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.due-today-item__name {
  font-weight: 600;
  color: var(--text-heading);
  display: block;
}

.due-today-item__meta {
  font-size: 0.75rem;
  color: var(--neutral-500);
}

.due-today-item__progress {
  height: 4px;
  background: var(--neutral-200);
  border-radius: 2px;
  margin-top: 0.35rem;
  overflow: hidden;
}

.due-today-item__progress-fill {
  height: 100%;
  background: var(--secondary);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.due-today-item__check.is-checked {
  animation: checkmark-pop 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes checkmark-pop {
  0% { transform: scale(0.6); opacity: 0.5; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.user-task-checkbox-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: var(--transition-fast);
}

.user-task-checkbox-btn:hover {
  transform: scale(1.08);
}

/* Goal cards — category tint uses --goals-surface from inline style */
.goals-card:hover {
  border-color: color-mix(in srgb, var(--goals-accent, var(--secondary)) 22%, var(--neutral-200));
}

/* Session goal chip */
.session-goal-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  background: hsl(202, 100%, 96%);
  color: var(--secondary-hover);
  border-radius: 9999px;
  text-decoration: none;
  margin-top: 0.35rem;
}

.session-goal-chip:hover {
  background: var(--secondary);
  color: var(--white);
}

/* Goal show sessions block */
.goal-detail-sessions {
  margin-top: var(--space-lg);
}

.goal-detail-sessions__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.goal-detail-sessions__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--neutral-50);
  border-radius: var(--radius-sm);
  border: 1px solid var(--neutral-200);
}

/* Journal card pile */
.reflection-journal-card {
  font-family: var(--font-display);
  box-shadow: var(--shadow-md), 4px 4px 0 var(--neutral-200);
  transition: var(--transition-smooth);
}

.reflection-journal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 6px 6px 0 var(--neutral-200);
}

.reflection-journal-cards--pile .reflection-journal-card:nth-child(odd) {
  transform: rotate(-0.5deg);
}

.reflection-journal-cards--pile .reflection-journal-card:nth-child(even) {
  transform: rotate(0.5deg);
}

.reflection-journal-cards--pile .reflection-journal-card:hover {
  transform: translateY(-2px) rotate(0deg);
}

.reflection-journal-title,
.reflection-journal-date {
  font-family: var(--font-display);
}

.reflection-editor-counter {
  font-size: 0.75rem;
  color: var(--neutral-500);
  text-align: right;
  margin-top: 0.25rem;
}

.new-reflection-prompt-btn.prompt-injected {
  animation: prompt-fade 0.3s ease;
}

@keyframes prompt-fade {
  from { opacity: 0.5; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Missions gold coin */
.mission-points-coin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, hsl(45, 93%, 55%) 0%, hsl(38, 92%, 45%) 100%);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 800;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.4);
  transition: transform 0.3s ease;
}

.mission-card:hover .mission-points-coin,
.missions-list--compact .mission-card:hover .mission-points-coin {
  animation: coin-spin 0.6s ease;
}

@keyframes coin-spin {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(180deg) scale(1.1); }
  100% { transform: rotateY(360deg); }
}

/* Leaderboard rank badges (shared) */
.leaderboard-rank-badge {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 800;
  flex-shrink: 0;
  background: var(--surface-sunken);
  color: var(--text-subtle);
  border: 1px solid var(--border-default);
  font-variant-numeric: tabular-nums;
}

.leaderboard-row--rank-1 .leaderboard-rank-badge {
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  color: #78350f;
  border-color: #fbbf24;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.28);
}

.leaderboard-row--rank-2 .leaderboard-rank-badge {
  background: linear-gradient(135deg, #e5e7eb, #9ca3af);
  color: #374151;
  border-color: #d1d5db;
}

.leaderboard-row--rank-3 .leaderboard-rank-badge {
  background: linear-gradient(135deg, #fdba74, #ea580c);
  color: #7c2d12;
  border-color: #fb923c;
}

/* Avatar color tones */
.leaderboard-avatar {
  border: 1.5px solid transparent;
  font-variant-numeric: tabular-nums;
}

.leaderboard-avatar--tone-0 {
  background: hsl(214, 72%, 92%);
  color: hsl(214, 55%, 38%);
  border-color: hsl(214, 55%, 82%);
}

.leaderboard-avatar--tone-1 {
  background: hsl(150, 55%, 90%);
  color: hsl(150, 45%, 32%);
  border-color: hsl(150, 45%, 78%);
}

.leaderboard-avatar--tone-2 {
  background: hsl(280, 55%, 92%);
  color: hsl(280, 45%, 38%);
  border-color: hsl(280, 45%, 82%);
}

.leaderboard-avatar--tone-3 {
  background: hsl(25, 90%, 92%);
  color: hsl(25, 70%, 38%);
  border-color: hsl(25, 70%, 82%);
}

.leaderboard-avatar--tone-4 {
  background: hsl(340, 65%, 92%);
  color: hsl(340, 50%, 38%);
  border-color: hsl(340, 50%, 82%);
}

.leaderboard-avatar--tone-5 {
  background: hsl(45, 85%, 90%);
  color: hsl(35, 70%, 35%);
  border-color: hsl(45, 70%, 78%);
}

/* Full leaderboard page */
.leaderboard-page {
  max-width: 40rem;
}

.leaderboard-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.leaderboard-page-header__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
}

.leaderboard-page-header__subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--text-subtle);
}

.leaderboard-page-header__privacy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
  color: var(--text-label);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.leaderboard-page-header__privacy:hover {
  border-color: color-mix(in srgb, var(--secondary) 40%, var(--border-default));
  color: var(--secondary);
  background: var(--accent-subtle);
}

.leaderboard-page-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius);
  background: var(--surface-sunken);
  border: 1px solid var(--border-default);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-subtle);
}

.leaderboard-page-note svg {
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: var(--secondary);
}

.leaderboard-page-card {
  margin-bottom: 0;
  overflow: hidden;
}

.leaderboard-page-card__body {
  padding: 0.75rem !important;
}

.leaderboard-list--page {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.leaderboard-row--page {
  display: grid;
  grid-template-columns: 2rem 2.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  margin: 0;
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  border: 1px solid var(--border-default);
  font-size: 0.9375rem;
  line-height: 1.2;
  transition: var(--transition-fast);
}

.leaderboard-row--page:hover:not(.leaderboard-row--you) {
  border-color: color-mix(in srgb, var(--secondary) 25%, var(--border-default));
  background: var(--surface-raised);
}

.leaderboard-row--page.leaderboard-row--rank-1 {
  background: linear-gradient(135deg, hsl(45, 100%, 97%) 0%, hsl(45, 90%, 92%) 100%);
  border-color: hsl(45, 85%, 78%);
}

.leaderboard-row--page.leaderboard-row--rank-2 {
  background: linear-gradient(135deg, hsl(210, 25%, 97%) 0%, hsl(210, 18%, 92%) 100%);
  border-color: hsl(210, 16%, 82%);
}

.leaderboard-row--page.leaderboard-row--rank-3 {
  background: linear-gradient(135deg, hsl(25, 100%, 97%) 0%, hsl(25, 90%, 92%) 100%);
  border-color: hsl(25, 80%, 78%);
}

.leaderboard-row--page .leaderboard-avatar {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.8125rem;
}

.leaderboard-row--page .leaderboard-name {
  font-weight: 500;
  color: var(--text-body);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row--page.leaderboard-row--rank-1 .leaderboard-name,
.leaderboard-row--page.leaderboard-row--rank-2 .leaderboard-name,
.leaderboard-row--page.leaderboard-row--rank-3 .leaderboard-name {
  font-weight: 600;
  color: var(--text-heading);
}

.leaderboard-score-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  text-align: right;
}

.leaderboard-row--page .leaderboard-score {
  font-variant-numeric: tabular-nums;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1;
}

.leaderboard-score-suffix {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
  white-space: nowrap;
}

.leaderboard-page .leaderboard-row--you {
  position: relative;
  background: linear-gradient(135deg, var(--secondary) 0%, hsl(202, 100%, 38%) 100%);
  border-color: transparent;
  color: var(--text-on-accent);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--secondary) 35%, transparent);
}

.leaderboard-page .leaderboard-row--you .leaderboard-name,
.leaderboard-page .leaderboard-row--you .leaderboard-score {
  color: var(--text-on-accent);
}

.leaderboard-page .leaderboard-row--you .leaderboard-score-suffix {
  color: color-mix(in srgb, var(--text-on-accent) 75%, transparent);
}

.leaderboard-page .leaderboard-row--you .leaderboard-rank-badge {
  background: rgba(255, 255, 255, 0.22);
  color: var(--text-on-accent);
  border-color: rgba(255, 255, 255, 0.35);
}

.leaderboard-page .leaderboard-row--you .leaderboard-avatar {
  background: rgba(255, 255, 255, 0.2) !important;
  color: var(--text-on-accent) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
}

.leaderboard-you-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-subtle) 0%, var(--surface-sunken) 100%);
  border: 1.5px solid color-mix(in srgb, var(--secondary) 30%, var(--border-default));
}

.leaderboard-you-strip__avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9375rem;
  font-weight: 700;
  background: var(--secondary);
  color: var(--text-on-accent);
  flex-shrink: 0;
}

.leaderboard-you-strip__info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.leaderboard-you-strip__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
}

.leaderboard-you-strip__rank {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1;
}

.leaderboard-you-strip__score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  text-align: right;
}

.leaderboard-you-strip__score-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.leaderboard-you-strip__score-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
  white-space: nowrap;
}

.leaderboard-empty--page {
  margin: 0;
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-subtle);
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-default);
}

/* Dashboard Weekly Board preview */
.leaderboard-card--preview {
  overflow: hidden;
}

.leaderboard-preview-header {
  margin-bottom: 0.625rem;
  flex-shrink: 0;
}

.leaderboard-preview-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.leaderboard-preview-header__row .user-dashboard-card-title {
  margin: 0;
  font-size: 0.9375rem;
}

.leaderboard-preview-meta {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--neutral-500);
}

.leaderboard-preview-meta__reset {
  flex: 1;
  min-width: 0;
}

.leaderboard-privacy-btn--compact {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.625rem;
  line-height: 1;
  padding: 0;
  color: var(--neutral-500);
  border-color: var(--neutral-300);
}

.leaderboard-card--preview .user-dashboard-card-body--flush {
  padding: 0;
}

.leaderboard-card--preview .leaderboard-list--preview {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
}

.leaderboard-card--preview .leaderboard-row--preview {
  display: grid;
  grid-template-columns: 1.75rem 1.75rem minmax(0, 1fr) 2.25rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  margin: 0;
  border-radius: var(--radius-md);
  background: var(--neutral-50);
  border: 1px solid var(--neutral-100);
  font-size: 0.8125rem;
  line-height: 1.2;
}

.leaderboard-card--preview .leaderboard-row--preview.leaderboard-row--rank-1 {
  background: linear-gradient(135deg, #fffbeb 0%, #fef9c3 100%);
  border-color: #fde68a;
}

.leaderboard-card--preview .leaderboard-row--preview.leaderboard-row--rank-2 {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border-color: #e5e7eb;
}

.leaderboard-card--preview .leaderboard-row--preview.leaderboard-row--rank-3 {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fed7aa;
}

.leaderboard-card--preview .leaderboard-row--preview.leaderboard-row--you {
  position: static;
  bottom: auto;
  z-index: auto;
  box-shadow: none;
  background: hsl(204, 100%, 97%);
  border-color: hsl(202, 72%, 82%);
  color: var(--text-heading);
}

.leaderboard-card--preview .leaderboard-rank-badge {
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 800;
  flex-shrink: 0;
  background: var(--neutral-200);
  color: var(--neutral-600);
}

.leaderboard-card--preview .leaderboard-row--rank-1 .leaderboard-rank-badge {
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  color: #78350f;
}

.leaderboard-card--preview .leaderboard-row--rank-2 .leaderboard-rank-badge {
  background: linear-gradient(135deg, #e5e7eb, #9ca3af);
  color: var(--text-label);
}

.leaderboard-card--preview .leaderboard-row--rank-3 .leaderboard-rank-badge {
  background: linear-gradient(135deg, #fdba74, #ea580c);
  color: #7c2d12;
}

.leaderboard-card--preview .leaderboard-avatar {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  background: var(--white);
  border: 1px solid var(--neutral-200);
  color: var(--neutral-600);
}

.leaderboard-card--preview .leaderboard-row--you .leaderboard-avatar {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--white);
}

.leaderboard-card--preview .leaderboard-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--neutral-700);
}

.leaderboard-card--preview .leaderboard-row--you .leaderboard-name {
  font-weight: 700;
  color: var(--text-heading);
}

.leaderboard-card--preview .leaderboard-score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
  color: var(--secondary);
  font-size: 0.875rem;
}

.leaderboard-card--preview .leaderboard-row--you .leaderboard-score {
  color: var(--secondary);
}

.leaderboard-you-strip--compact {
  margin-top: 0.625rem;
  padding: 0.75rem 0.875rem;
  gap: 0.625rem;
}

.leaderboard-you-strip--compact .leaderboard-you-strip__avatar {
  width: 2rem;
  height: 2rem;
  font-size: 0.8125rem;
}

.leaderboard-you-strip--compact .leaderboard-you-strip__rank {
  font-size: 1.0625rem;
}

.leaderboard-you-strip--compact .leaderboard-you-strip__score-value {
  font-size: 1.0625rem;
}

.leaderboard-empty--preview {
  margin: 0;
  padding: 1.25rem 0.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--neutral-500);
  background: var(--neutral-50);
  border-radius: var(--radius-md);
}

.dashboard-v2__row--paired .leaderboard-card--preview .leaderboard-list--preview {
  max-height: none;
  overflow: visible;
}

/* Quick log loading pulse */
.quick-log-form__submit.is-loading {
  pointer-events: none;
  position: relative;
  color: transparent;
}

.quick-log-form__submit.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes confetti-fly {
  to {
    transform: translate(var(--dx), var(--dy));
    opacity: 0;
  }
}

/* Checkbox confetti burst */
.confetti-burst {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
}

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

  .dashboard-v2__row--goals-due {
    grid-template-columns: 1fr;
  }

  .dashboard-v2__row--goals-due .dashboard-goals-hero__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .dashboard-goals-hero__grid {
    grid-template-columns: 1fr;
  }

  .dashboard-v2__row--goals-due .dashboard-goals-hero__grid,
  .dashboard-v2__row--paired {
    grid-template-columns: 1fr;
  }

  .user-dashboard-focus-header--compact .user-dashboard-greeting {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-dashboard-focus-header--compact .user-dashboard-quote-ticker {
    text-align: left;
    max-width: none;
  }
}

/* Sprint 3 — legal pages, goal sort, celebrations, sessions */
.legal-page {
  max-width: 720px;
}

.legal-header {
  margin-bottom: var(--space-lg);
}

.legal-back-link {
  display: inline-block;
  margin-bottom: var(--space-sm);
  color: var(--gt-color-primary, #2563eb);
  text-decoration: none;
  font-size: 0.875rem;
}

.legal-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 0;
}

.legal-content h2 {
  font-size: 1.125rem;
  margin: 1.5rem 0 0.5rem;
}

.legal-content p,
.legal-content li {
  color: var(--neutral-600);
  line-height: 1.6;
}

.legal-updated {
  color: var(--neutral-500);
  font-size: 0.875rem;
}

.goals-sort-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: var(--space-md);
}

.goals-sort-label {
  font-size: 0.875rem;
  color: var(--neutral-500);
  margin-right: 0.25rem;
}

.celebration-modal__panel {
  text-align: center;
  padding: 1.5rem;
}

.celebration-modal__title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.celebration-modal__body {
  margin: 0 0 1.25rem;
  color: var(--neutral-600);
}

.celebration-modal__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.session-start-btn {
  margin-top: 0.75rem;
  display: inline-flex;
  font-size: 0.875rem;
  padding: 0.4rem 0.75rem;
}

/* ============================================
   DARK MODE — cross-page overrides
   ============================================ */

[data-theme="dark"] .user-sidebar,
[data-theme="dark"] .user-navbar,
[data-theme="dark"] .user-search-input,
[data-theme="dark"] .user-dropdown-menu,
[data-theme="dark"] .user-dashboard-select,
[data-theme="dark"] .user-dashboard-task-item,
[data-theme="dark"] .reflection-journal-card,
[data-theme="dark"] .missions-card,
[data-theme="dark"] .coaching-preview-card,
[data-theme="dark"] .leaderboard-card,
[data-theme="dark"] .leaderboard-card--preview,
[data-theme="dark"] .gt-card,
[data-theme="dark"] .goals-card-menu-dropdown,
[data-theme="dark"] .goals-filter-chip,
[data-theme="dark"] .goal-template-card,
[data-theme="dark"] .session-card,
[data-theme="dark"] .goal-detail-card,
[data-theme="dark"] .goal-detail-panel,
[data-theme="dark"] .sub-goal-modal__dialog,
[data-theme="dark"] .quick-log-log-modal__card,
[data-theme="dark"] .celebration-modal__dialog {
  background: var(--surface-raised);
  border-color: var(--border-default);
  color: var(--neutral-900);
}

[data-theme="dark"] .user-search-input:focus,
[data-theme="dark"] .user-dashboard-select:focus {
  background: var(--surface-raised);
}

[data-theme="dark"] .user-search-icon {
  color: var(--neutral-500);
}

[data-theme="dark"] .search-hero-input,
[data-theme="dark"] .search-result-card,
[data-theme="dark"] .search-empty-prompt {
  background: var(--surface-raised);
  border-color: var(--border-default);
}

[data-theme="dark"] .search-hero-input:focus {
  box-shadow: 0 0 0 3px hsla(var(--secondary-base), 0.2);
}

[data-theme="dark"] .search-section__count {
  background: var(--neutral-200);
  color: var(--neutral-900);
}

[data-theme="dark"] .search-result-card mark {
  background: hsla(var(--accent-base), 0.2);
}

[data-theme="dark"] .user-dropdown-item-danger:hover {
  background: var(--danger-bg);
}

[data-theme="dark"] .user-dashboard-task-item:hover {
  border-color: var(--neutral-300);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .dashboard-stat-icon--goals {
  background: hsl(234, 40%, 18%);
  color: #a5b4fc;
}

[data-theme="dark"] .dashboard-stat-icon--checkins {
  background: hsl(150, 35%, 16%);
  color: #6ee7b7;
}

[data-theme="dark"] .dashboard-stat-icon--streaks {
  background: hsl(32, 40%, 16%);
  color: #fcd34d;
}

[data-theme="dark"] .dashboard-stat-icon--points {
  background: hsl(199, 40%, 16%);
  color: #7dd3fc;
}

[data-theme="dark"] .user-dashboard-reflection-box {
  background: linear-gradient(135deg, hsl(202, 45%, 16%) 0%, hsl(210, 30%, 14%) 100%);
  border-color: hsl(202, 50%, 28%);
}

[data-theme="dark"] .user-dashboard-reflection-date {
  color: var(--neutral-700);
}

[data-theme="dark"] .user-dashboard-reflection-view-link {
  color: var(--secondary);
}

[data-theme="dark"] .reflection-journal-text {
  color: var(--neutral-500);
}

[data-theme="dark"] .coaching-preview-card .coaching-preview-text {
  color: var(--neutral-700);
}

[data-theme="dark"] .missions-list .missions-card--claimable {
  border-color: hsl(45, 70%, 35%);
  background: linear-gradient(135deg, hsl(45, 40%, 14%) 0%, var(--surface-raised) 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .today-week-strip__chip:hover {
  color: var(--text-on-accent);
}

[data-theme="dark"] .quick-log-goal-card__sub-goals {
  color: #c4b5fd;
  background: hsl(262, 35%, 22%);
}

[data-theme="dark"] .quick-log-goal-card__note {
  color: var(--neutral-500);
}

[data-theme="dark"] .quick-log-log-modal__card[data-phase="done"] .quick-log-goal-card__logging {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.28);
  color: #34d399;
}

[data-theme="dark"] .quick-log-form__input,
[data-theme="dark"] .quick-log-form__textarea {
  background: var(--surface-sunken);
  border-color: var(--border-default);
  color: var(--neutral-900);
}

[data-theme="dark"] .quick-log-form__input::placeholder,
[data-theme="dark"] .quick-log-form__textarea::placeholder {
  color: var(--neutral-500);
}

[data-theme="dark"] .sub-goal-modal__input,
[data-theme="dark"] .sub-goal-modal__textarea,
[data-theme="dark"] .sub-goal-modal__select {
  background: var(--surface-sunken);
  border-color: var(--border-default);
  color: var(--neutral-900);
}

[data-theme="dark"] .sub-goal-modal__input:hover,
[data-theme="dark"] .sub-goal-modal__textarea:hover,
[data-theme="dark"] .sub-goal-modal__select:hover,
[data-theme="dark"] .sub-goal-modal__input:focus,
[data-theme="dark"] .sub-goal-modal__textarea:focus,
[data-theme="dark"] .sub-goal-modal__select:focus {
  background: var(--surface-raised);
  border-color: var(--secondary);
}

[data-theme="dark"] .sub-goal-modal__input--date {
  color-scheme: dark;
}

[data-theme="dark"] .sub-goal-modal__priority-group {
  background: var(--surface-sunken);
}

[data-theme="dark"] .goal-detail-sub-goals__add-btn {
  background: var(--surface-sunken);
  border-color: var(--border-default);
  color: var(--secondary);
}

[data-theme="dark"] .goal-detail-sub-goals__add-btn:hover {
  background: var(--accent-subtle);
}

[data-theme="dark"] .goal-detail-card,
[data-theme="dark"] .goal-detail-overview,
[data-theme="dark"] .goal-detail-log-card,
[data-theme="dark"] .goal-detail-activity-day {
  background: var(--surface-raised);
  border-color: var(--border-default);
}

[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not(.login-input):not(.login-submit-btn),
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background-color: var(--surface-sunken);
  border-color: var(--border-default);
  color: var(--neutral-900);
}

[data-theme="dark"] .login-page-container input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
[data-theme="dark"] .login-page-container textarea,
[data-theme="dark"] .login-page-container select,
[data-theme="dark"] .auth-container input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
[data-theme="dark"] .auth-container textarea,
[data-theme="dark"] .auth-container select {
  background-color: #ffffff;
  border-color: hsl(210, 20%, 90%);
  color: hsl(210, 15%, 12%);
  color-scheme: light;
}

[data-theme="dark"] .login-page-container input.login-submit-btn {
  background-color: #9ca3af;
  border-color: transparent;
  color: #ffffff;
}

[data-theme="dark"] .login-page-container input.login-submit-btn:hover {
  background-color: #6b7280;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--neutral-500);
}

[data-theme="dark"] .new-goal-section-title,
[data-theme="dark"] .new-goal-input-prefix,
[data-theme="dark"] .new-goal-input-suffix,
[data-theme="dark"] .new-goal-help-text {
  color: var(--neutral-500);
}

[data-theme="dark"] .new-goal-separator {
  background: var(--border-default);
}

[data-theme="dark"] .new-goal-checkbox-item {
  background: var(--surface-sunken);
}

[data-theme="dark"] .new-goal-checkbox-label {
  color: var(--neutral-900);
}

[data-theme="dark"] .new-goal-toggle-slider {
  background-color: var(--neutral-300);
}

[data-theme="dark"] .new-goal-toggle-slider:before {
  background-color: var(--text-on-accent);
}

[data-theme="dark"] .new-goal-info-box {
  background: hsl(214, 45%, 18%);
  border-color: hsl(214, 40%, 28%);
}

[data-theme="dark"] .new-goal-info-box p {
  color: #93c5fd;
}

[data-theme="dark"] circle[stroke="#e5e7eb"],
[data-theme="dark"] circle[stroke="#E5E7EB"] {
  stroke: var(--neutral-200);
}

/* Primary CTA buttons keep accent fill in dark mode */
[data-theme="dark"] .user-add-goal-btn,
[data-theme="dark"] .btn-track {
  background: var(--primary);
  border-color: transparent;
  color: var(--text-on-accent);
}

[data-theme="dark"] .user-add-goal-btn:hover,
[data-theme="dark"] .btn-track:hover {
  background: var(--primary-light);
  border-color: transparent;
  color: var(--text-on-accent);
}

/* Text on filled primary surfaces stays light */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-track,
[data-theme="dark"] .phone-btn-yes,
[data-theme="dark"] .filter-chip.active,
[data-theme="dark"] .goal-date-btn.active,
[data-theme="dark"] .goals-show-date-btn.active,
[data-theme="dark"] .goals-show-history-today-badge,
[data-theme="dark"] .goals-show-milestone-number,
[data-theme="dark"] .goals-show-milestone-badge.unlocked,
[data-theme="dark"] .track-goal-drawer__action--primary,
[data-theme="dark"] .user-add-goal-btn--filled,
[data-theme="dark"] .leaderboard-page .leaderboard-row--you,
[data-theme="dark"] .leaderboard-page .leaderboard-row--you .leaderboard-name,
[data-theme="dark"] .leaderboard-page .leaderboard-row--you .leaderboard-score {
  color: var(--text-on-accent);
}

[data-theme="dark"] .goals-filter-chip.active,
[data-theme="dark"] .goal-template-filter-chip.active {
  color: var(--secondary);
}

/* Accent buttons must keep light label text in dark mode */
[data-theme="dark"] .gt-btn--primary,
[data-theme="dark"] .gt-btn--primary:hover,
[data-theme="dark"] .goals-add-button,
[data-theme="dark"] .reflection-journal-add-btn,
[data-theme="dark"] .sessions-add-btn,
[data-theme="dark"] .template-details-add-btn,
[data-theme="dark"] .session-edit-save-btn:not(:disabled),
[data-theme="dark"] .goal-form-step-indicator.is-active {
  color: var(--text-on-accent);
}

[data-theme="dark"] .dashboard-stat-value {
  color: var(--secondary);
}

[data-theme="dark"] .coaching-hero-card,
[data-theme="dark"] .coaching-actions-panel,
[data-theme="dark"] .coaching-analytics-card,
[data-theme="dark"] .coaching-recent-card,
[data-theme="dark"] .coaching-info-modal-panel {
  background: var(--surface-raised);
  border-color: var(--border-default);
}

[data-theme="dark"] .coaching-action-icon--journal { background: hsl(210, 14%, 22%); }
[data-theme="dark"] .coaching-action-icon--focus { background: hsl(150, 30%, 18%); color: #6ee7b7; }
[data-theme="dark"] .coaching-action-icon--rest { background: hsl(202, 45%, 18%); color: #7dd3fc; }
[data-theme="dark"] .coaching-action-icon--goal { background: hsl(24, 35%, 18%); color: #fdba74; }
[data-theme="dark"] .coaching-action-icon--summary { background: hsl(234, 35%, 20%); color: #a5b4fc; }
[data-theme="dark"] .coaching-action-icon--checkin { background: hsl(202, 45%, 18%); color: #7dd3fc; }
[data-theme="dark"] .coaching-action-icon--default { background: hsl(210, 14%, 22%); }

[data-theme="dark"] .coaching-line-area {
  fill: rgba(125, 211, 252, 0.12);
}

[data-theme="dark"] .coaching-line-stroke {
  stroke: #7dd3fc;
}

[data-theme="dark"] .coaching-stacked-fill {
  background: #4a6fa5;
}

[data-theme="dark"] .coaching-stacked-bar {
  background: #5b7cbf;
}

[data-theme="dark"] .coaching-legend-dot--productivity { background: #4a6fa5; }
[data-theme="dark"] .coaching-legend-dot--rest { background: #7dd3fc; }

[data-theme="dark"] .coaching-badge--on-track {
  background: hsl(150, 35%, 18%);
  color: #6ee7b7;
}

[data-theme="dark"] .user-sidebar-link:hover,
[data-theme="dark"] .user-sidebar-link.active {
  color: var(--secondary);
}

[data-theme="dark"] .settings-title,
[data-theme="dark"] .missions-empty-title,
[data-theme="dark"] .missions-empty-state__text,
[data-theme="dark"] .missions-history-title,
[data-theme="dark"] .missions-list .missions-card-title,
[data-theme="dark"] .leaderboard-preview-header__row .user-dashboard-card-title {
  color: var(--text-heading);
}

/* Goal detail */
[data-theme="dark"] .goal-detail-overview-title,
[data-theme="dark"] .goal-detail-card-title,
[data-theme="dark"] .goal-detail-ring-count,
[data-theme="dark"] .goal-detail-streak-stat-value,
[data-theme="dark"] .goal-detail-insights-summary,
[data-theme="dark"] .goal-detail-sub-goals__name,
[data-theme="dark"] .goal-detail-sub-goals__count {
  color: var(--text-heading);
}

[data-theme="dark"] .goal-detail-overview-pct-value,
[data-theme="dark"] .goal-detail-sub-goals__pct,
[data-theme="dark"] .goal-detail-breadcrumb a,
[data-theme="dark"] .goal-detail-insights-link,
[data-theme="dark"] .goal-detail-link {
  color: var(--secondary);
}

[data-theme="dark"] .goal-detail-tag--category {
  background: hsl(214, 45%, 20%);
  color: #93c5fd;
}

[data-theme="dark"] .goal-detail-tag--category.goal-detail-tag--wellness {
  background: hsl(150, 35%, 18%);
  color: #6ee7b7;
}

[data-theme="dark"] .goal-detail-tag--category.goal-detail-tag--productivity {
  background: hsl(214, 40%, 20%);
  color: #93c5fd;
}

[data-theme="dark"] .goal-detail-tag--frequency {
  background: var(--surface-sunken);
  color: var(--text-label);
}

[data-theme="dark"] .goal-detail-insights {
  background: linear-gradient(135deg, hsl(262, 28%, 16%) 0%, hsl(214, 30%, 15%) 100%);
}

[data-theme="dark"] .goal-detail-completed-banner {
  background: var(--success-bg);
  color: var(--success);
}

[data-theme="dark"] .goal-detail-sub-goals__row--completed {
  background: hsl(150, 30%, 14%);
  border-color: hsl(150, 35%, 28%);
}

[data-theme="dark"] .goal-detail-sub-goals__row--in_progress {
  background: hsl(214, 35%, 14%);
  border-color: hsl(214, 40%, 28%);
}

[data-theme="dark"] .goal-detail-sub-goals__check--in_progress {
  background: hsl(214, 45%, 20%);
  border-color: var(--secondary);
}

[data-theme="dark"] .goal-detail-heatmap-cell--missed {
  background: var(--neutral-200);
}

[data-theme="dark"] .goal-detail-heatmap-cell--skipped {
  background: hsl(214, 35%, 20%);
}

[data-theme="dark"] .goal-detail-heatmap-cell--pending {
  background: var(--surface-sunken);
  border-color: var(--border-default);
}

[data-theme="dark"] .goals-show-card,
[data-theme="dark"] .goals-show-edit-btn {
  background: var(--surface-raised);
  border-color: var(--border-default);
}

/* Missions */
[data-theme="dark"] .missions-list .missions-card,
[data-theme="dark"] .missions-page .user-dashboard-card {
  background: var(--surface-raised);
  border-color: var(--border-default);
}

[data-theme="dark"] .missions-list .missions-card--claimed {
  background: var(--surface-sunken);
}

[data-theme="dark"] .missions-list .missions-card-badge--claim {
  background: hsl(45, 40%, 18%);
  color: #fcd34d;
}

[data-theme="dark"] .missions-list .missions-card-badge--claimed {
  background: hsl(150, 35%, 18%);
  color: #6ee7b7;
}

[data-theme="dark"] .missions-list .missions-card-badge--expired {
  background: var(--surface-sunken);
}

[data-theme="dark"] .missions-list .missions-card-progress-bar,
[data-theme="dark"] .missions-row-progress-bar {
  background: var(--surface-sunken);
}

[data-theme="dark"] .missions-hero-ring-bg {
  stroke: var(--neutral-200);
}

[data-theme="dark"] .missions-success-state {
  background: linear-gradient(135deg, hsl(150, 30%, 14%) 0%, hsl(214, 30%, 14%) 100%);
  border-color: hsl(150, 35%, 28%);
}

/* Leaderboard */
[data-theme="dark"] .leaderboard-page .gt-card,
[data-theme="dark"] .leaderboard-modal-content {
  background: var(--surface-raised);
  border-color: var(--border-default);
}

[data-theme="dark"] .leaderboard-row--page {
  background: var(--surface-sunken);
  border-color: var(--border-default);
}

[data-theme="dark"] .leaderboard-row--page.leaderboard-row--rank-1 {
  background: linear-gradient(135deg, hsl(45, 40%, 16%) 0%, hsl(45, 35%, 12%) 100%);
  border-color: hsl(45, 40%, 28%);
}

[data-theme="dark"] .leaderboard-row--page.leaderboard-row--rank-2 {
  background: linear-gradient(135deg, hsl(210, 14%, 20%) 0%, hsl(210, 12%, 16%) 100%);
  border-color: var(--border-default);
}

[data-theme="dark"] .leaderboard-row--page.leaderboard-row--rank-3 {
  background: linear-gradient(135deg, hsl(25, 40%, 16%) 0%, hsl(25, 35%, 12%) 100%);
  border-color: hsl(25, 40%, 28%);
}

[data-theme="dark"] .leaderboard-row--page .leaderboard-name {
  color: var(--text-body);
}

[data-theme="dark"] .leaderboard-row--page.leaderboard-row--rank-1 .leaderboard-name,
[data-theme="dark"] .leaderboard-row--page.leaderboard-row--rank-2 .leaderboard-name,
[data-theme="dark"] .leaderboard-row--page.leaderboard-row--rank-3 .leaderboard-name {
  color: var(--text-heading);
}

[data-theme="dark"] .leaderboard-avatar--tone-0 {
  background: hsl(214, 45%, 22%);
  color: hsl(214, 70%, 78%);
  border-color: hsl(214, 40%, 32%);
}

[data-theme="dark"] .leaderboard-avatar--tone-1 {
  background: hsl(150, 35%, 20%);
  color: hsl(150, 55%, 72%);
  border-color: hsl(150, 30%, 30%);
}

[data-theme="dark"] .leaderboard-avatar--tone-2 {
  background: hsl(280, 35%, 22%);
  color: hsl(280, 55%, 78%);
  border-color: hsl(280, 30%, 32%);
}

[data-theme="dark"] .leaderboard-avatar--tone-3 {
  background: hsl(25, 40%, 20%);
  color: hsl(25, 75%, 75%);
  border-color: hsl(25, 35%, 30%);
}

[data-theme="dark"] .leaderboard-avatar--tone-4 {
  background: hsl(340, 35%, 22%);
  color: hsl(340, 55%, 78%);
  border-color: hsl(340, 30%, 32%);
}

[data-theme="dark"] .leaderboard-avatar--tone-5 {
  background: hsl(45, 40%, 18%);
  color: hsl(45, 80%, 75%);
  border-color: hsl(45, 35%, 28%);
}

[data-theme="dark"] .leaderboard-you-strip,
[data-theme="dark"] .leaderboard-your-rank,
[data-theme="dark"] .leaderboard-your-rank--card {
  background: linear-gradient(135deg, hsl(202, 60%, 16%) 0%, var(--surface-sunken) 100%);
  border-color: hsl(202, 50%, 28%);
  color: var(--text-heading);
}

/* Dashboard leaderboard preview — rank rows stay readable in dark mode */
[data-theme="dark"] .leaderboard-card--preview .leaderboard-row--preview {
  background: var(--surface-sunken);
  border-color: var(--border-default);
}

[data-theme="dark"] .leaderboard-card--preview .leaderboard-row--preview.leaderboard-row--rank-1 {
  background: linear-gradient(135deg, hsl(45, 40%, 16%) 0%, hsl(45, 35%, 12%) 100%);
  border-color: hsl(45, 40%, 28%);
}

[data-theme="dark"] .leaderboard-card--preview .leaderboard-row--preview.leaderboard-row--rank-2 {
  background: linear-gradient(135deg, hsl(210, 14%, 20%) 0%, hsl(210, 12%, 16%) 100%);
  border-color: var(--border-default);
}

[data-theme="dark"] .leaderboard-card--preview .leaderboard-row--preview.leaderboard-row--rank-3 {
  background: linear-gradient(135deg, hsl(25, 40%, 16%) 0%, hsl(25, 35%, 12%) 100%);
  border-color: hsl(25, 40%, 28%);
}

[data-theme="dark"] .leaderboard-card--preview .leaderboard-row--preview.leaderboard-row--you {
  background: hsl(202, 60%, 18%);
  border-color: hsl(202, 50%, 32%);
  color: var(--text-heading);
}

[data-theme="dark"] .leaderboard-card--preview .leaderboard-name {
  color: var(--text-body);
}

[data-theme="dark"] .leaderboard-card--preview .leaderboard-row--rank-1 .leaderboard-name,
[data-theme="dark"] .leaderboard-card--preview .leaderboard-row--rank-2 .leaderboard-name,
[data-theme="dark"] .leaderboard-card--preview .leaderboard-row--rank-3 .leaderboard-name {
  color: var(--text-heading);
}

[data-theme="dark"] .leaderboard-empty--preview {
  background: var(--surface-sunken);
  color: var(--text-subtle);
}

[data-theme="dark"] .leaderboard-privacy-btn {
  border-color: var(--border-default);
  color: var(--text-label);
}

[data-theme="dark"] .leaderboard-modal-body p {
  color: var(--text-label);
}

[data-theme="dark"] .goal-detail-log-icon--done {
  background: hsl(150, 35%, 18%);
  color: #6ee7b7;
}

[data-theme="dark"] .goal-detail-log-icon--done .goal-detail-icon {
  color: #6ee7b7;
}

[data-theme="dark"] .goal-detail-log-icon--missed {
  background: var(--surface-sunken);
}

[data-theme="dark"] .goal-detail-reflection-box {
  background: var(--surface-sunken);
}