/* ==========================================================================
   WealthGrid — Shared Theme
   A warm, clean, approachable design for a household expense tracking app.
   Built on top of Bootstrap 5.3.3 + Bootstrap Icons 1.11.3 (loaded via CDN).
   ========================================================================== */

/* ==========================================================================
   1. CSS Custom Properties (Design Tokens)
   ========================================================================== */
:root {
  /* Primary palette */
  --fm-primary: #2E8B6E;
  --fm-primary-dark: #1F6B54;
  --fm-primary-light: #E8F5F0;
  --fm-primary-rgb: 46, 139, 110;

  /* Accent */
  --fm-accent: #F4A261;
  --fm-accent-dark: #D4854A;
  --fm-accent-light: #FDF0E7;

  /* Neutrals */
  --fm-bg: #F7F6F3;
  --fm-surface: #FFFFFF;
  --fm-text: #2D3436;
  --fm-text-muted: #636E72;
  --fm-border: #E0E0DC;
  --fm-border-light: #F0EFEC;

  /* Semantic */
  --fm-success: #2E8B6E;
  --fm-success-bg: #E8F5F0;
  --fm-warning: #F4A261;
  --fm-warning-bg: #FDF0E7;
  --fm-danger: #E74C3C;
  --fm-danger-bg: #FDEDEC;
  --fm-info: #3498DB;
  --fm-info-bg: #EBF5FB;

  /* Elevation */
  --fm-shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.04);
  --fm-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --fm-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --fm-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10);

  /* Radii */
  --fm-radius-sm: 6px;
  --fm-radius: 10px;
  --fm-radius-lg: 14px;
  --fm-radius-full: 9999px;

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

  /* Typography */
  --fm-font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --fm-font-size-base: 1rem;
  --fm-font-size-sm: 0.875rem;
  --fm-font-size-xs: 0.75rem;
  --fm-font-size-lg: 1.25rem;
  --fm-font-size-xl: 1.5rem;
  --fm-font-size-2xl: 2rem;
  --fm-line-height: 1.6;

  /* Transitions */
  --fm-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --fm-transition-fast: all 0.15s ease-in-out;

  /* Z-index layers */
  --fm-z-navbar: 1030;
  --fm-z-fab: 1040;
  --fm-z-modal: 1050;
  --fm-z-toast: 1080;
}

/* ==========================================================================
   2. Base Styles
   ========================================================================== */
body {
  font-family: var(--fm-font-family);
  font-size: var(--fm-font-size-base);
  line-height: var(--fm-line-height);
  color: var(--fm-text);
  background-color: var(--fm-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--fm-text);
  line-height: 1.3;
}

a {
  color: var(--fm-primary);
  text-decoration: none;
  transition: var(--fm-transition-fast);
}

a:hover {
  color: var(--fm-primary-dark);
}

/* ==========================================================================
   3. Navbar (.navbar-fm)
   ========================================================================== */
.navbar-fm {
  background-color: var(--fm-surface);
  box-shadow: var(--fm-shadow-sm);
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: var(--fm-z-navbar);
}

.navbar-fm .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--fm-text);
}

.navbar-fm .navbar-brand .brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--fm-radius-sm);
  background: linear-gradient(135deg, var(--fm-primary), var(--fm-primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
}

.navbar-fm .nav-link {
  color: var(--fm-text-muted);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--fm-radius-sm);
  transition: var(--fm-transition-fast);
}

.navbar-fm .nav-link:hover,
.navbar-fm .nav-link:focus {
  color: var(--fm-primary);
  background-color: var(--fm-primary-light);
}

.navbar-fm .nav-link.active {
  color: var(--fm-primary);
  background-color: var(--fm-primary-light);
}

.navbar-fm .navbar-toggler {
  border: none;
  box-shadow: none;
  padding: 0.25rem 0.5rem;
}

.navbar-fm .navbar-toggler:focus {
  box-shadow: none;
}

/* ==========================================================================
   4. Card Styles (.fm-card)
   ========================================================================== */
.fm-card {
  background-color: var(--fm-surface);
  border: 1px solid var(--fm-border-light);
  border-radius: var(--fm-radius-lg);
  box-shadow: var(--fm-shadow);
  transition: var(--fm-transition);
  padding: 1.5rem;
}

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

.fm-card .card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--fm-border-light);
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: var(--fm-font-size-lg);
}

.fm-card .card-body {
  padding: 0;
}

.fm-card .card-footer {
  background-color: transparent;
  border-top: 1px solid var(--fm-border-light);
  padding: 0.75rem 1.25rem;
}

/* ==========================================================================
   5. Button Styles
   ========================================================================== */
.btn-fm-primary {
  background-color: var(--fm-primary);
  border-color: var(--fm-primary);
  color: #fff;
  font-weight: 500;
  border-radius: var(--fm-radius);
  padding: 0.625rem 1.25rem;
  transition: var(--fm-transition);
}

.btn-fm-primary:hover,
.btn-fm-primary:focus {
  background-color: var(--fm-primary-dark);
  border-color: var(--fm-primary-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--fm-primary-rgb), 0.3);
  transform: translateY(-1px);
}

.btn-fm-primary:active {
  transform: translateY(0);
}

.btn-fm-primary:disabled {
  background-color: var(--fm-primary-light);
  border-color: var(--fm-primary-light);
  color: var(--fm-text-muted);
}

.btn-fm-secondary {
  background-color: var(--fm-surface);
  border: 1px solid var(--fm-border);
  color: var(--fm-text);
  font-weight: 500;
  border-radius: var(--fm-radius);
  padding: 0.625rem 1.25rem;
  transition: var(--fm-transition);
}

.btn-fm-secondary:hover,
.btn-fm-secondary:focus {
  background-color: var(--fm-bg);
  border-color: var(--fm-primary);
  color: var(--fm-primary);
}

.btn-fm-danger {
  background-color: var(--fm-danger);
  border-color: var(--fm-danger);
  color: #fff;
  font-weight: 500;
  border-radius: var(--fm-radius);
  padding: 0.625rem 1.25rem;
  transition: var(--fm-transition);
}

.btn-fm-danger:hover,
.btn-fm-danger:focus {
  background-color: #C0392B;
  border-color: #C0392B;
  color: #fff;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
  transform: translateY(-1px);
}

.btn-fm-outline {
  background-color: transparent;
  border: 2px solid var(--fm-primary);
  color: var(--fm-primary);
  font-weight: 500;
  border-radius: var(--fm-radius);
  padding: 0.5rem 1.25rem;
  transition: var(--fm-transition);
}

.btn-fm-outline:hover,
.btn-fm-outline:focus {
  background-color: var(--fm-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--fm-primary-rgb), 0.3);
}

/* ==========================================================================
   6. Form Styles
   ========================================================================== */
.form-control,
.form-select {
  border-radius: var(--fm-radius);
  border-color: var(--fm-border);
  font-size: var(--fm-font-size-base);
  padding: 0.625rem 0.875rem;
  transition: var(--fm-transition-fast);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--fm-primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--fm-primary-rgb), 0.15);
  background-color: var(--fm-surface);
}

.form-control::placeholder,
.form-select {
  color: var(--fm-text-muted);
}

.form-label {
  font-weight: 500;
  font-size: var(--fm-font-size-sm);
  color: var(--fm-text);
  margin-bottom: 0.375rem;
}

.form-label.required::after {
  content: " *";
  color: #E74C3C;
  font-weight: 600;
}

.form-text {
  font-size: var(--fm-font-size-xs);
  color: var(--fm-text-muted);
}

/* File upload dropzone */
.form-dropzone {
  border: 2px dashed var(--fm-border);
  border-radius: var(--fm-radius-lg);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--fm-transition);
  background-color: var(--fm-bg);
}

.form-dropzone:hover,
.form-dropzone.dragover {
  border-color: var(--fm-primary);
  background-color: var(--fm-primary-light);
}

.form-dropzone .dropzone-icon {
  font-size: 2.5rem;
  color: var(--fm-primary);
  margin-bottom: 0.5rem;
}

.form-dropzone .dropzone-text {
  color: var(--fm-text-muted);
  font-size: var(--fm-font-size-sm);
}

/* ==========================================================================
   7. Badge Styles (.badge-category)
   ========================================================================== */
.badge-category {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--fm-radius-full);
  font-size: var(--fm-font-size-xs);
  font-weight: 600;
  letter-spacing: 0.025em;
}

.badge-category .badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Color variants — map to category colors */
.badge-category.badge-food {
  background-color: #E8F5F0;
  color: #1F6B54;
}
.badge-category.badge-food .badge-dot {
  background-color: #2E8B6E;
}

.badge-category.badge-transport {
  background-color: #EBF5FB;
  color: #1A5276;
}
.badge-category.badge-transport .badge-dot {
  background-color: #3498DB;
}

.badge-category.badge-rent {
  background-color: #F4ECF7;
  color: #6C3483;
}
.badge-category.badge-rent .badge-dot {
  background-color: #8E44AD;
}

.badge-category.badge-utilities {
  background-color: #FEF9E7;
  color: #7D6608;
}
.badge-category.badge-utilities .badge-dot {
  background-color: #F1C40F;
}

.badge-category.badge-entertainment {
  background-color: #FDEDEC;
  color: #922B21;
}
.badge-category.badge-entertainment .badge-dot {
  background-color: #E74C3C;
}

.badge-category.badge-health {
  background-color: #FDEBD0;
  color: #9C640C;
}
.badge-category.badge-health .badge-dot {
  background-color: #F4A261;
}

.badge-category.badge-education {
  background-color: #D6EAF8;
  color: #1B4F72;
}
.badge-category.badge-education .badge-dot {
  background-color: #2980B9;
}

.badge-category.badge-other {
  background-color: #F2F3F4;
  color: #566573;
}
.badge-category.badge-other .badge-dot {
  background-color: #636E72;
}

/* Generic badge-dot utility */
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ==========================================================================
   8. Progress Bars (Budget Tracking)
   ========================================================================== */
.fm-progress {
  height: 10px;
  border-radius: var(--fm-radius-full);
  background-color: var(--fm-border-light);
  overflow: hidden;
}

.fm-progress .progress-bar {
  border-radius: var(--fm-radius-full);
  transition: width 0.6s ease-in-out;
}

.fm-progress .progress-bar--ok {
  background-color: var(--fm-success);
}

.fm-progress .progress-bar--warn {
  background-color: var(--fm-warning);
}

.fm-progress .progress-bar--danger {
  background-color: var(--fm-danger);
}

/* Budget bar variant (thicker, with label) */
.budget-bar {
  position: relative;
  height: 24px;
  border-radius: var(--fm-radius-full);
  background-color: var(--fm-border-light);
  overflow: hidden;
}

.budget-bar .budget-bar-fill {
  height: 100%;
  border-radius: var(--fm-radius-full);
  transition: width 0.6s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.5rem;
}

.budget-bar .budget-bar-fill--ok {
  background: linear-gradient(90deg, var(--fm-primary), var(--fm-primary-dark));
}

.budget-bar .budget-bar-fill--warn {
  background: linear-gradient(90deg, var(--fm-accent), var(--fm-accent-dark));
}

.budget-bar .budget-bar-fill--danger {
  background: linear-gradient(90deg, var(--fm-danger), #C0392B);
}

.budget-bar .budget-bar-label {
  font-size: var(--fm-font-size-xs);
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

/* ==========================================================================
   9. Table Styles (.table-fm)
   ========================================================================== */
.table-fm {
  --bs-table-bg: transparent;
  --bs-table-color: var(--fm-text);
  --bs-table-border-color: var(--fm-border-light);
  --bs-table-hover-bg: var(--fm-primary-light);
  --bs-table-hover-color: var(--fm-text);

  border-radius: var(--fm-radius);
  overflow: hidden;
  font-size: var(--fm-font-size-sm);
}

.table-fm thead th {
  background-color: var(--fm-bg);
  color: var(--fm-text-muted);
  font-weight: 600;
  font-size: var(--fm-font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom-width: 2px;
  border-bottom-color: var(--fm-border);
  padding: 0.75rem 1rem;
}

.table-fm tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border-color: var(--fm-border-light);
}

.table-fm tbody tr {
  transition: var(--fm-transition-fast);
  cursor: pointer;
}

.table-fm tbody tr:hover {
  background-color: var(--fm-primary-light);
}

.table-fm .amount-cell {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-fm .receipt-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--fm-radius-sm);
  border: 1px solid var(--fm-border);
}

/* ==========================================================================
   10. Alert / Flash Message Styles
   ========================================================================== */
.alert-fm {
  border: none;
  border-radius: var(--fm-radius);
  padding: 0.875rem 1.25rem;
  font-size: var(--fm-font-size-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: fm-slide-in 0.3s ease-out;
}

.alert-fm .alert-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.alert-fm-success {
  background-color: var(--fm-success-bg);
  color: var(--fm-primary-dark);
  border-left: 4px solid var(--fm-success);
}

.alert-fm-warning {
  background-color: var(--fm-warning-bg);
  color: #7D6608;
  border-left: 4px solid var(--fm-warning);
}

.alert-fm-danger {
  background-color: var(--fm-danger-bg);
  color: #922B21;
  border-left: 4px solid var(--fm-danger);
}

.alert-fm-info {
  background-color: var(--fm-info-bg);
  color: #1A5276;
  border-left: 4px solid var(--fm-info);
}

/* ==========================================================================
   11. FAB (Floating Action Button)
   ========================================================================== */
.fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fm-primary), var(--fm-primary-dark));
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--fm-shadow-md);
  border: none;
  z-index: var(--fm-z-fab);
  transition: var(--fm-transition);
  text-decoration: none;
}

.fab:hover,
.fab:focus {
  color: #fff;
  transform: scale(1.08);
  box-shadow: var(--fm-shadow-lg);
}

.fab:active {
  transform: scale(0.95);
}

.fab-fab {
  bottom: 1.5rem;
  right: 1.5rem;
}

/* ==========================================================================
   12. Dashboard-Specific Styles
   ========================================================================== */
.stat-card {
  background: var(--fm-surface);
  border-radius: var(--fm-radius-lg);
  border: 1px solid var(--fm-border-light);
  box-shadow: var(--fm-shadow-sm);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--fm-transition);
}

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

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

.stat-card .stat-icon--primary {
  background-color: var(--fm-primary-light);
  color: var(--fm-primary);
}

.stat-card .stat-icon--accent {
  background-color: var(--fm-accent-light);
  color: var(--fm-accent-dark);
}

.stat-card .stat-icon--danger {
  background-color: var(--fm-danger-bg);
  color: var(--fm-danger);
}

.stat-card .stat-icon--info {
  background-color: var(--fm-info-bg);
  color: var(--fm-info);
}

.stat-card .stat-value {
  font-size: var(--fm-font-size-xl);
  font-weight: 700;
  color: var(--fm-text);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: var(--fm-font-size-xs);
  color: var(--fm-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Budget bar on dashboard */
.budget-bar {
  margin-bottom: 0.75rem;
}

.budget-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.375rem;
  font-size: var(--fm-font-size-sm);
}

.budget-bar-header .budget-bar-category {
  font-weight: 500;
  color: var(--fm-text);
}

.budget-bar-header .budget-bar-amount {
  font-size: var(--fm-font-size-xs);
  color: var(--fm-text-muted);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   13. Responsive Adjustments
   ========================================================================== */
@media (max-width: 991.98px) {
  .navbar-fm .navbar-nav .nav-link {
    padding: 0.5rem 0.75rem;
  }

  .fab {
    bottom: 1rem;
    right: 1rem;
    width: 52px;
    height: 52px;
    font-size: 1.375rem;
  }
}

@media (max-width: 767.98px) {
  .stat-card {
    padding: 1rem;
    flex-direction: column;
    text-align: center;
  }

  .stat-card .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.125rem;
  }

  .stat-card .stat-value {
    font-size: var(--fm-font-size-lg);
  }

  .table-fm {
    font-size: var(--fm-font-size-xs);
  }

  .table-fm thead th,
  .table-fm tbody td {
    padding: 0.5rem 0.625rem;
  }

  .fm-card .card-body {
    padding: 1rem;
  }

  .budget-bar {
    height: 20px;
  }

  .budget-bar .budget-bar-label {
    display: none;
  }

  .alert-fm {
    padding: 0.75rem 1rem;
    font-size: var(--fm-font-size-xs);
  }
}

@media (max-width: 575.98px) {
  .fab {
    bottom: 0.75rem;
    right: 0.75rem;
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }

  .navbar-fm {
    padding: 0.5rem 1rem;
  }

  .navbar-fm .navbar-brand {
    font-size: 1.125rem;
  }

  .navbar-fm .navbar-brand .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
}

/* ==========================================================================
   14. Utility Classes
   ========================================================================== */
.text-muted-fm {
  color: var(--fm-text-muted) !important;
}

.text-primary-fm {
  color: var(--fm-primary) !important;
}

.text-accent-fm {
  color: var(--fm-accent) !important;
}

.text-danger-fm {
  color: var(--fm-danger) !important;
}

.bg-primary-fm {
  background-color: var(--fm-primary) !important;
}

.bg-primary-light-fm {
  background-color: var(--fm-primary-light) !important;
}

.bg-bg-fm {
  background-color: var(--fm-bg) !important;
}

.card-hover {
  transition: var(--fm-transition);
}

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

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.badge-dot--primary {
  background-color: var(--fm-primary);
}

.badge-dot--accent {
  background-color: var(--fm-accent);
}

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

.badge-dot--muted {
  background-color: var(--fm-text-muted);
}

.cursor-pointer {
  cursor: pointer;
}

/* Touch-friendly icon buttons (44px minimum tap target) */
.icon-btn-lg {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.avatar-initials {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--fm-primary-light);
  color: var(--fm-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--fm-font-size-xs);
  flex-shrink: 0;
}

.avatar-initials--lg {
  width: 48px;
  height: 48px;
  font-size: var(--fm-font-size-sm);
}

.avatar-initials--sm {
  width: 28px;
  height: 28px;
  font-size: 0.6875rem;
}

/* ==========================================================================
   15. Color Picker Swatches
   ========================================================================== */
.color-swatch {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    border-radius: 50%;
    transition: var(--fm-transition-fast);
}

.color-swatch::after {
    content: '';
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: inherit;
    border: 2px solid transparent;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.selected {
    box-shadow: 0 0 0 2px var(--fm-surface), 0 0 0 4px var(--fm-text);
}

/* ==========================================================================
    15b. Category Suggestion Chips
    ========================================================================== */
.category-suggestion {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  min-height: 44px;
  border-radius: var(--fm-radius-full);
  font-size: var(--fm-font-size-xs);
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--fm-transition-fast);
  line-height: 1.4;
}

.category-suggestion:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
}

.category-suggestion:active {
  transform: translateY(0);
}

/* ==========================================================================
    16. Animations
    ========================================================================== */
@keyframes fm-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fm-slide-in {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fm-fade-in-scale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fm-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.fm-fade-in {
  animation: fm-fade-in 0.4s ease-out both;
}

.fm-fade-in-scale {
  animation: fm-fade-in-scale 0.3s ease-out both;
}

.fm-pulse {
  animation: fm-pulse 1.5s ease-in-out infinite;
}

/* Staggered fade-in for lists */
.fm-stagger > * {
  animation: fm-fade-in 0.4s ease-out both;
}

.fm-stagger > *:nth-child(1) { animation-delay: 0.03s; }
.fm-stagger > *:nth-child(2) { animation-delay: 0.06s; }
.fm-stagger > *:nth-child(3) { animation-delay: 0.09s; }
.fm-stagger > *:nth-child(4) { animation-delay: 0.12s; }
.fm-stagger > *:nth-child(5) { animation-delay: 0.15s; }
.fm-stagger > *:nth-child(6) { animation-delay: 0.18s; }
.fm-stagger > *:nth-child(7) { animation-delay: 0.21s; }
.fm-stagger > *:nth-child(8) { animation-delay: 0.24s; }
.fm-stagger > *:nth-child(9) { animation-delay: 0.27s; }
.fm-stagger > *:nth-child(10) { animation-delay: 0.30s; }

/* Page content entrance */
.page-content {
  animation: fm-fade-in 0.35s ease-out;
}

/* Toast animation */
.fm-toast {
  animation: fm-slide-in 0.3s ease-out;
}

/* Reduced motion preference */
/* ==========================================================================
   17. AI Status Badges
   ========================================================================== */
.ai-badge {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  vertical-align: middle;
}

.ai-badge-pending {
  background-color: #D6EAF8;
  color: #1A5276;
  border: 1px solid #2E86C1;
  animation: fm-ai-pulse 1.5s ease-in-out infinite;
}

.ai-badge-completed {
  background-color: #D5F5E3;
  color: #1E8449;
  border: 1px solid #27AE60;
}

.ai-badge-failed {
  background-color: #FADBD8;
  color: #922B21;
  border: 1px solid #E74C3C;
}

@keyframes fm-ai-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  .fm-fade-in,
  .fm-fade-in-scale,
  .fm-pulse,
  .fm-stagger > *,
  .page-content,
  .fm-toast,
  .fm-card,
  .stat-card,
  .card-hover,
  .fab,
  .fm-progress .progress-bar,
  .budget-bar .budget-bar-fill,
  .ai-badge-pending {
    animation: none !important;
    transition: none !important;
  }
}
