/* =========================================
   Under Water 2 - Professional Fintech UI
   Clean, Modern Dark Theme
   ========================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

html, body {
  background: #0f1419;
  color: #e7e9ea;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  font-size: 15px;
  line-height: 1.5;
}

/* ================================
   DESIGN TOKENS - Dark Theme
   ================================ */
:root {
  --bg-primary: #0f1419;
  --bg-secondary: #1a1f26;
  --bg-tertiary: #22272e;
  --bg-elevated: #2d333b;
  --card-bg: #1a1f26;
  --accent-primary: #3b9eed;
  --accent-secondary: #2f81c9;
  --accent-muted: rgba(59, 158, 237, 0.15);
  --success-green: #22c55e;
  --success-muted: rgba(34, 197, 94, 0.15);
  --danger-red: #ef4444;
  --danger-muted: rgba(239, 68, 68, 0.15);
  --warning-orange: #f59e0b;
  --text-primary: #e7e9ea;
  --text-secondary: #8b949e;
  --text-tertiary: #6e7681;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.3);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
}

/* ================================
   LIGHT MODE THEME
   ================================ */
html[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f6f8fa;
  --bg-tertiary: #eef1f4;
  --bg-elevated: #ffffff;
  --card-bg: #ffffff;
  --accent-primary: #0969da;
  --accent-secondary: #0550ae;
  --accent-muted: rgba(9, 105, 218, 0.1);
  --success-green: #1a7f37;
  --success-muted: rgba(26, 127, 55, 0.1);
  --danger-red: #cf222e;
  --danger-muted: rgba(207, 34, 46, 0.1);
  --warning-orange: #bf8700;
  --text-primary: #1f2328;
  --text-secondary: #656d76;
  --text-tertiary: #8b949e;
  --border-color: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] body {
  background: #ffffff;
  color: #1f2328;
}

/* ================================
   ACCESSIBILITY UTILITIES
   ================================ */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}


/* ================================
   TYPOGRAPHY
   ================================ */
h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ================================
   FORM ELEMENTS - Base
   ================================ */
input, select, textarea {
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-secondary);
}

input::placeholder, textarea::placeholder {
  color: var(--text-tertiary);
}

select {
  cursor: pointer;
}

/* ================================
   AUTH SCREEN
   ================================ */
.auth-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 1rem;
}

.auth-container {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 2rem;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.3s ease;
}

.auth-header {
  margin-bottom: 1.5rem;
}

.auth-logo {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  object-fit: cover;
}

.auth-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0;
}

.auth-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 1.5rem 0 1.25rem 0;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 0.625rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  border-radius: var(--radius-sm);
}

.auth-tab:hover {
  color: var(--text-primary);
}

.auth-tab-active {
  background: var(--accent-primary);
  color: #ffffff;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.auth-form-hidden {
  display: none;
}

.auth-form h2 {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.auth-form input {
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.auth-form input:focus {
  border-color: var(--accent-primary);
}

.auth-error {
  color: var(--danger-red);
  font-size: 0.8125rem;
  min-height: 18px;
  margin-top: 0.25rem;
}

.auth-btn {
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent-primary);
  color: #ffffff;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--transition-fast), transform var(--transition-fast);
  margin-top: 0.25rem;
}

.auth-btn:hover {
  background: var(--accent-secondary);
  transform: translateY(-1px);
}

.auth-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.8125rem;
  transition: color var(--transition-fast);
  cursor: pointer;
}

.auth-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.auth-link-btn {
  background: none;
  border: none;
  color: var(--accent-primary);
  cursor: pointer;
  font-size: 0.8125rem;
  padding: 0.5rem 0;
  transition: color var(--transition-fast);
  font-family: inherit;
  font-weight: 500;
}

.auth-link-btn:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* ================================
   APP SHELL
   ================================ */
.app-shell {
  display: flex;
  height: 100vh;
  background: var(--bg-primary);
  position: relative;
}

.app-shell-hidden {
  display: none;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.sidebar-overlay.active {
  display: block;
}

/* ================================
   SIDEBAR
   ================================ */
.sidebar {
  position: fixed;
  left: -100%;
  top: 0;
  width: 260px;
  height: 100vh;
  background: var(--bg-secondary);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.75rem;
  z-index: 1001;
  transition: left 0.25s ease;
  border-right: 1px solid var(--border-color);
}

.sidebar.active {
  left: 0;
}

.sidebar-header {
  margin-bottom: 1.5rem;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.sidebar-header h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.nav-item-active {
  background: var(--accent-muted);
  color: var(--accent-primary);
}

.nav-item-active:hover {
  background: var(--accent-muted);
  color: var(--accent-primary);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.user-email {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  word-break: break-word;
  line-height: 1.4;
  padding: 0 0.5rem;
}

.logout-btn {
  padding: 0.5rem 0.75rem;
  background: var(--danger-muted);
  color: var(--danger-red);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.logout-btn:hover {
  background: var(--danger-red);
  color: #ffffff;
}

/* ================================
   MENU BUTTON (Hamburger Icon)
   ================================ */
.menu-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.625rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1002;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

.menu-icon {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  position: relative;
  transition: all 0.2s ease;
}

.menu-icon::before,
.menu-icon::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  left: 0;
  transition: all 0.2s ease;
}

.menu-icon::before {
  top: -6px;
}

.menu-icon::after {
  top: 6px;
}

/* Animate to X when sidebar is open */
.menu-btn[aria-expanded="true"] .menu-icon {
  background: transparent;
}

.menu-btn[aria-expanded="true"] .menu-icon::before {
  transform: rotate(45deg);
  top: 0;
}

.menu-btn[aria-expanded="true"] .menu-icon::after {
  transform: rotate(-45deg);
  top: 0;
}

/* ================================
   MAIN CONTENT
   ================================ */
.app-content {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-top: 2.5rem;
}

#recurring-view .page-header {
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

#recurring-view .page-header h1 {
  width: 100%;
  text-align: center;
}

#recurring-view #recurring-form-toggle {
  width: 100%;
  max-width: 200px;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

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

.app-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.app-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.view {
  display: none;
}

.view-active {
  display: block;
  animation: fadeIn 0.25s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================================
   GLOBAL SEARCH
   ================================ */
.search-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  width: 250px;
}

.search-container input {
  width: 100%;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.8125rem;
}

.search-container input:focus {
  border-color: var(--accent-primary);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 0.25rem;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: none;
}

.search-results.active {
  display: block;
}

/* ================================
   BUTTONS
   ================================ */
.btn-primary {
  padding: 0.625rem 1.25rem;
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-primary:hover {
  background: var(--accent-secondary);
  transform: translateY(-1px);
}

.btn-secondary {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--accent-muted);
}

.btn {
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-nav {
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-nav:hover {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
}

.btn-export {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* ================================
   DASHBOARD CARDS
   ================================ */
.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
}

.dashboard-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.dashboard-card:hover {
  border-color: var(--border-hover);
}

.dashboard-card-paycheck {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

.dashboard-card-paycheck:hover {
  border-color: var(--border-hover);
}

#dash-end-balance-card {
  cursor: default;
}

#dash-end-balance-card:hover {
  border-color: var(--border-color);
}

.card-label {
  color: var(--text-tertiary);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.card-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-value-red {
  color: var(--danger-red);
}

.card-value-green {
  color: var(--success-green);
}

.card-value-blue {
  color: var(--accent-primary);
}

.card-detail {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* ================================
   PRESSURE LIST
   ================================ */
.pressure-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.pressure-list li {
  background: var(--bg-tertiary);
  border-left: 3px solid var(--accent-primary);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.pressure-list li:hover {
  background: var(--bg-elevated);
}

.pressure-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pressure-dot-red {
  background: var(--danger-red);
}

.pressure-dot-orange {
  background: var(--warning-orange);
}

.pressure-dot-yellow {
  background: #eab308;
}

.pressure-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.pressure-date {
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
}

.pressure-amount {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

/* ================================
   CALENDAR
   ================================ */
.calendar-container {
  width: 100%;
}

.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

#calendar-month-label {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  text-align: center;
  margin: 0;
}

.calendar-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.summary-label {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 0.5rem;
  font-weight: 600;
  text-align: center;
  font-size: 0.75rem;
  background: var(--bg-secondary);
  padding: 0.625rem 2px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.weekday {
  padding: 0.375rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  background: var(--bg-secondary);
  padding: 2px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}

.calendar-day {
  background: var(--card-bg);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.375rem;
  min-height: 56px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0.125rem;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.calendar-day:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
}

.calendar-day-empty {
  background: var(--bg-primary);
  cursor: default;
}

.calendar-day-empty:hover {
  background: var(--bg-primary);
  border-color: transparent;
}

.calendar-day-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  line-height: 1;
}

.day-number {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-primary);
}

.calendar-day-indicators {
  display: flex;
  gap: 3px;
  margin-top: 2px;
}

.indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.payday-dot {
  background: #2ecc71;
}

.bill-dot {
  background: var(--warning-orange);
}

.debt-dot {
  background: #e74c3c;
}

.subscription-dot {
  background: #3498db;
}

.calendar-day-net {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: auto;
  flex: 1;
  justify-content: center;
}

.calendar-day-net .net-income {
  color: var(--success-green);
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.2;
}

.calendar-day-net .net-expense {
  color: var(--danger-red);
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.2;
}

.day-balance {
  color: var(--text-secondary);
  font-size: 0.5625rem;
  font-weight: 500;
  margin-top: auto;
  padding-top: 2px;
  line-height: 1;
  opacity: 0.8;
}

.day-balance.negative {
  color: var(--danger-red);
  opacity: 1;
}

.day-balance.warning {
  color: var(--warning-orange);
  opacity: 1;
}

/* Calendar Header Actions */
.calendar-header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.year-picker {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.year-picker:hover {
  border-color: var(--accent-primary);
}

/* Calendar Legend */
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface-elevated);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-income {
  background: var(--success-green);
}

.legend-expense {
  background: var(--danger-red);
}

.legend-today {
  background: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary-alpha);
}

.legend-payday {
  background: #f1c40f;
}

.legend-bill-due {
  background: var(--warning-orange);
}

/* Today Highlight */
.calendar-day-today {
  border: 2px solid var(--accent-primary) !important;
  background: rgba(59, 158, 237, 0.08) !important;
  box-shadow: 0 0 0 3px rgba(59, 158, 237, 0.15);
}

.calendar-day-today .calendar-day-header .day-number {
  background: var(--accent-primary);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Weekend Styling */
.calendar-day-weekend {
  background: rgba(255, 255, 255, 0.02);
}

.weekday.weekend {
  color: var(--text-tertiary);
}

/* Payday Highlight */
.calendar-day-payday {
  /* dots only - no border */
}

.day-indicator {
  display: none;
}

.payday-indicator,
.debt-indicator,
.subscription-indicator {
  display: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Bill Due Indicator */
.calendar-day-bill-due {
  /* dots only - no border */
}

/* Debt Due Indicator */
.calendar-day-debt-due {
  /* dots only - no border */
}

.debt-indicator {
  position: absolute;
  top: 2px;
  right: 22px;
  font-size: 0.625rem;
  opacity: 0.9;
}

/* Subscription Indicator */
.calendar-day-subscription {
  /* dots only - no border */
}

.subscription-indicator {
  position: absolute;
  top: 2px;
  right: 40px;
  font-size: 0.5rem;
  opacity: 0.85;
}

/* Transaction Badge */

.transaction-badge {
  background: var(--accent-primary);
  color: white;
  font-size: 0.5625rem;
  font-weight: 600;
  padding: 0.125rem 0.3125rem;
  border-radius: 999px;
  min-width: 16px;
  text-align: center;
}

/* Calendar Events Container */
.calendar-events {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.125rem;
  padding: 0.25rem 0;
}

.calendar-event-empty {
  color: var(--text-tertiary);
  font-size: 0.6875rem;
  text-align: center;
  opacity: 0.5;
}

/* Quick Add Button on Day */
.day-quick-add {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.calendar-day:hover .day-quick-add {
  opacity: 1;
}

.day-quick-add:hover {
  transform: scale(1.15);
  background: var(--accent-secondary);
}

/* Week Totals */
.week-totals {
  margin-top: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.week-totals-header {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.week-totals-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.week-total-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 1fr;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8125rem;
}

.week-total-row.simplified {
  grid-template-columns: 80px 1fr;
}

.week-total-row:last-child {
  border-bottom: none;
}

.week-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.week-income {
  color: var(--success-green);
  text-align: right;
}

.week-expense {
  color: var(--danger-red);
  text-align: right;
}

.week-net {
  font-weight: 600;
  text-align: right;
}

.week-net.positive {
  color: var(--success-green);
}

.week-net.negative {
  color: var(--danger-red);
}

/* Calendar Footer */
.calendar-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  gap: 2rem;
}

.balance-trend {
  flex: 1;
}

.trend-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.balance-trend-svg {
  display: block;
}

.trend-values {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.calendar-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Summary Values with Colors */
.summary-value.income-value {
  color: var(--success-green);
}

.summary-value.expense-value {
  color: var(--danger-red);
}

.summary-value.positive-value {
  color: var(--success-green);
}

.summary-value.negative-value {
  color: var(--danger-red);
}

.summary-item-mini {
  flex: 0.5 !important;
}

/* Enhanced Day Modal */
.day-modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.day-modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
}

.today-badge {
  background: var(--accent-primary);
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
}

.day-balance-card {
  background: var(--surface-elevated);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.balance-row {
  display: flex;
  justify-content: space-between;
  padding: 0.375rem 0;
  font-size: 0.875rem;
}

.balance-row.income-row {
  color: var(--success-green);
}

.balance-row.expense-row {
  color: var(--danger-red);
}

.balance-row.total-row {
  border-top: 1px solid var(--border-color);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
}

.balance-row .positive {
  color: var(--success-green);
}

.balance-row .negative {
  color: var(--danger-red);
}

/* Transaction Groups in Modal */
.day-transactions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.transaction-group {
  background: var(--surface-elevated);
  border-radius: var(--radius-md);
  padding: 0.75rem;
}

.transaction-group h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.8125rem;
  font-weight: 600;
}

.income-group {
  border-left: 3px solid var(--success-green);
}

.expense-group {
  border-left: 3px solid var(--danger-red);
}

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  margin: 0.25rem 0;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
}

.transaction-item.clickable {
  cursor: pointer;
}

.transaction-item.clickable:hover {
  background: var(--surface-elevated);
}

.transaction-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.transaction-name {
  font-weight: 500;
  font-size: 0.875rem;
}

.projected-badge,
.recurring-badge,
.category-badge {
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  border-radius: 999px;
  font-weight: 500;
}

.projected-badge {
  background: rgba(241, 196, 15, 0.15);
  color: #f1c40f;
}

.recurring-badge {
  background: rgba(155, 89, 182, 0.15);
  color: #9b59b6;
}

.debt-badge {
  background: rgba(155, 89, 182, 0.2);
  color: #9b59b6;
  font-weight: 600;
}

.subscription-badge {
  background: var(--accent-muted);
  color: var(--accent-primary);
}

.category-badge {
  background: rgba(59, 158, 237, 0.15);
  color: var(--accent-primary);
}

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

.transaction-amount {
  font-weight: 600;
  font-size: 0.875rem;
}

.income-item .transaction-amount {
  color: var(--success-green);
}

.expense-item .transaction-amount {
  color: var(--danger-red);
}

.debt-item {
  border-left: 3px solid #9b59b6;
  background: rgba(155, 89, 182, 0.08);
}

.debt-item .transaction-amount,
.debt-value {
  color: #9b59b6;
}

.delete-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 1.125rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.delete-btn:hover {
  background: rgba(231, 76, 60, 0.15);
  color: var(--danger-red);
}

.no-transactions {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-tertiary);
}

.no-transactions p {
  margin: 0 0 1rem 0;
}

.add-transaction-btn {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.add-transaction-btn:hover {
  background: var(--accent-secondary);
}

/* ================================
   RECURRING BILLS CARDS
   ================================ */
.bills-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.875rem;
  padding: 0;
}

#recurring-table-body {
  display: contents;
}

.bill-card-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  transition: border-color var(--transition-fast);
  overflow: hidden;
}

.bill-card-item:hover {
  border-color: var(--border-hover);
}

.bill-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.625rem;
}

.bill-card-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
  flex: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.subscription-badge {
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  background: var(--accent-muted);
  color: var(--accent-primary);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.subscription-toggle {
  margin: 0.5rem 0;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.subscription-toggle .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.subscription-toggle .checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.subscription-toggle .toggle-hint {
  margin: 0.5rem 0 0 0;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.bill-card-amount {
  font-weight: 700;
  font-size: 0.875rem;
  white-space: nowrap;
}

.bill-card-amount.income {
  color: var(--success-green);
}

.bill-card-amount.expense {
  color: var(--danger-red);
}

.bill-card-details {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.75rem;
}

.bill-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.bill-detail-label {
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.625rem;
  letter-spacing: 0.05em;
}

.bill-detail-value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

.bill-detail-value.type-income {
  color: var(--success-green);
}

.bill-detail-value.type-expense {
  color: var(--danger-red);
}

.bill-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.bill-card-actions button {
  padding: 0.375rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.bill-card-actions .rec-edit {
  background: var(--accent-muted);
  color: var(--accent-primary);
}

.bill-card-actions .rec-edit:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.bill-card-actions .rec-delete {
  background: var(--danger-muted);
  color: var(--danger-red);
}

.bill-card-actions .rec-delete:hover {
  background: var(--danger-red);
  color: #ffffff;
}

.no-bills-message {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--text-secondary);
  display: none;
  font-size: 0.875rem;
}

.no-bills-message p {
  margin: 0;
}

/* ================================
   SETTINGS
   ================================ */
.settings-container {
  max-width: 560px;
}

.settings-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
}

.settings-section h3 {
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  font-size: 1rem;
  font-weight: 600;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.settings-form label {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
}

.settings-form input,
.settings-form select,
.settings-form textarea {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.settings-form input:focus,
.settings-form select:focus,
.settings-form textarea:focus {
  border-color: var(--accent-primary);
}

/* ================================
   THEME TOGGLE SWITCH
   ================================ */
.theme-toggle-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle-label {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.875rem;
}

.theme-toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

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

.theme-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-tertiary);
  transition: background var(--transition-normal);
  border-radius: 26px;
  border: 1px solid var(--border-color);
}

.theme-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-secondary);
  transition: transform var(--transition-normal), background var(--transition-normal);
  border-radius: 50%;
}

input:checked + .theme-toggle-slider {
  background-color: var(--accent-muted);
  border-color: var(--accent-primary);
}

input:checked + .theme-toggle-slider:before {
  transform: translateX(22px);
  background-color: var(--accent-primary);
}

/* ================================
   MODAL
   ================================ */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
}

.modal-visible {
  display: flex !important;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
}

.modal-content h3 {
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
  border-color: var(--accent-primary);
}

.modal-close {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 0.375rem 0.5rem;
  transition: color var(--transition-fast);
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.day-detail-section {
  margin-bottom: 1.25rem;
}

.day-detail-section p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0.375rem 0;
}

.day-events {
  margin: 0.875rem 0;
}

.day-events h4 {
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
}

.detail-income {
  color: var(--success-green);
  padding: 0.625rem;
  margin: 0.375rem 0;
  background: var(--success-muted);
  border-left: 3px solid var(--success-green);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.detail-income:hover {
  background: rgba(34, 197, 94, 0.25);
}

.detail-expense {
  color: var(--danger-red);
  padding: 0.625rem;
  margin: 0.375rem 0;
  background: var(--danger-muted);
  border-left: 3px solid var(--danger-red);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.day-totals {
  margin-top: 1.25rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border-color);
}

.day-totals p {
  margin: 0.5rem 0;
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.day-totals p span:last-child {
  font-weight: 600;
  color: var(--text-primary);
}

.form-status {
  font-size: 0.8125rem;
  min-height: 18px;
  color: var(--danger-red);
  margin-top: 0.375rem;
}

.form-status.success {
  color: var(--success-green);
}

.form-error {
  color: var(--danger-red);
  font-size: 0.8125rem;
  min-height: 18px;
}

/* ================================
   ACCOUNTS VIEW
   ================================ */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.875rem;
  padding: 0;
}

.account-card-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  transition: border-color var(--transition-fast);
  overflow: hidden;
}

.account-card-item:hover {
  border-color: var(--border-hover);
}

.account-card-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.account-card-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.account-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.account-card-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.account-card-type {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.account-card-balance {
  font-size: 1.375rem;
  font-weight: 700;
  text-align: center;
  padding: 0.625rem 0;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
}

.account-card-balance.positive {
  color: var(--success-green);
}

.account-card-balance.negative {
  color: var(--danger-red);
}

.account-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.account-card-actions button {
  padding: 0.375rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.account-card-actions .account-edit {
  background: var(--accent-muted);
  color: var(--accent-primary);
}

.account-card-actions .account-edit:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.account-card-actions .account-delete {
  background: var(--danger-muted);
  color: var(--danger-red);
}

.account-card-actions .account-delete:hover {
  background: var(--danger-red);
  color: #ffffff;
}

.no-accounts-message,
.account-error-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ================================
   TRANSACTIONS VIEW
   ================================ */
.transactions-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-bottom: 1.25rem;
  padding: 0.875rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  align-items: center;
}

.transactions-filters select,
.transactions-filters input[type="date"] {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.8125rem;
  min-width: 120px;
  flex: 1;
  max-width: 160px;
}

.transactions-filters select:focus,
.transactions-filters input[type="date"]:focus {
  border-color: var(--accent-primary);
}

#transactions-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.transaction-item {
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  gap: 0.875rem;
  align-items: center;
  padding: 0.875rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition-fast);
}

.transaction-item:hover {
  border-color: var(--border-hover);
}

.tx-date {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.tx-info {
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
  min-width: 0;
}

.tx-description {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-meta {
  display: flex;
  gap: 0.625rem;
  font-size: 0.6875rem;
  color: var(--text-secondary);
}

.tx-category {
  background: var(--accent-muted);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  color: var(--accent-primary);
}

.tx-account {
  opacity: 0.8;
}

.tx-amount {
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  text-align: right;
  min-width: 90px;
}

.tx-amount-income {
  color: var(--success-green);
}

.tx-amount-expense {
  color: var(--danger-red);
}

.tx-actions {
  display: flex;
  gap: 0.375rem;
}

.tx-actions button {
  padding: 0.375rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tx-actions .tx-edit {
  background: var(--accent-muted);
  color: var(--accent-primary);
}

.tx-actions .tx-edit:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.tx-actions .tx-delete {
  background: var(--danger-muted);
  color: var(--danger-red);
}

.tx-actions .tx-delete:hover {
  background: var(--danger-red);
  color: #ffffff;
}

.no-transactions-message,
.transactions-error-message,
.loading-message {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ================================
   BUDGET VIEW
   ================================ */
.budget-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}

.budget-summary-card {
  flex: 1;
  min-width: 130px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  text-align: center;
}

.budget-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.budget-value {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.budget-spent {
  color: var(--danger-red);
}

.budget-remaining {
  color: var(--success-green);
}

.budget-over {
  color: var(--danger-red);
}

#budget-categories-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.budget-category-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  transition: border-color var(--transition-fast);
}

.budget-category-item:hover {
  border-color: var(--border-hover);
}

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

.budget-category-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border: 2px solid;
  flex-shrink: 0;
}

.budget-category-info {
  flex: 1;
  min-width: 0;
}

.budget-category-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.125rem;
}

.budget-category-limit {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.budget-category-actions {
  display: flex;
  gap: 0.375rem;
}

.budget-category-actions button {
  padding: 0.375rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.budget-category-actions .cat-edit {
  background: var(--accent-muted);
  color: var(--accent-primary);
}

.budget-category-actions .cat-edit:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.budget-category-actions .cat-delete {
  background: var(--danger-muted);
  color: var(--danger-red);
}

.budget-category-actions .cat-delete:hover {
  background: var(--danger-red);
  color: #ffffff;
}

.budget-progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.budget-progress-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.budget-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease, background-color var(--transition-normal);
}

.budget-progress-success {
  background: var(--success-green) !important;
}

.budget-progress-warning {
  background: var(--warning-orange) !important;
}

.budget-progress-danger {
  background: var(--danger-red) !important;
}

.budget-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
}

.budget-progress-text .budget-spent {
  color: var(--text-secondary);
}

.budget-remaining-text {
  color: var(--success-green);
  font-weight: 500;
}

.budget-remaining-text.over-budget {
  color: var(--danger-red);
}

.no-categories-message,
.budget-error-message {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ================================
   REPORTS VIEW
   ================================ */
.reports-filters {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0.875rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.reports-filters select {
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.8125rem;
  min-width: 120px;
  cursor: pointer;
}

.reports-filters select:focus {
  border-color: var(--accent-primary);
}

.reports-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}

.reports-summary-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  transition: border-color var(--transition-fast);
}

.reports-summary-card:hover {
  border-color: var(--border-hover);
}

.reports-card-income {
  border-left: 3px solid var(--success-green);
}

.reports-card-expenses {
  border-left: 3px solid var(--danger-red);
}

.reports-card-net {
  border-left: 3px solid var(--accent-primary);
}

.reports-card-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.reports-card-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.reports-value-green {
  color: var(--success-green);
}

.reports-value-red {
  color: var(--danger-red);
}

.reports-card-change {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.reports-card-change.change-up {
  color: var(--success-green);
}

.reports-card-change.change-down {
  color: var(--danger-red);
}

.reports-card-change.change-up-bad {
  color: var(--danger-red);
}

.reports-card-change.change-down-good {
  color: var(--success-green);
}

.reports-card-subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.reports-chart-container {
  margin-bottom: 1.25rem;
}

.reports-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.reports-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.no-data-message {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: center;
  padding: 1.5rem 1rem;
}

.category-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.chart-bar-item {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.chart-bar-label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.chart-bar-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.chart-bar-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.chart-bar-value {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.chart-bar-track {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ================================
   GOALS VIEW
   ================================ */
.goals-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}

.goals-summary-card {
  flex: 1;
  min-width: 140px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  text-align: center;
}

.goals-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.goals-value {
  font-size: 1.375rem;
  font-weight: 700;
}

.goals-saved {
  color: var(--success-green);
}

.goals-target {
  color: var(--accent-primary);
}

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

.goal-card-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  transition: border-color var(--transition-fast);
}

.goal-card-item:hover {
  border-color: var(--border-hover);
}

.goal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.goal-card-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
  flex: 1;
}

.goal-card-icon {
  font-size: 1.25rem;
}

.goal-progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.goal-progress-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.goal-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent-primary);
  transition: width 0.4s ease;
}

.goal-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
}

.goal-saved {
  color: var(--success-green);
  font-weight: 500;
}

.goal-target {
  color: var(--text-secondary);
}

.goal-card-actions {
  display: flex;
  gap: 0.375rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.goal-card-actions button {
  flex: 1;
  padding: 0.375rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.goal-card-actions .goal-add-funds {
  background: var(--success-muted);
  color: var(--success-green);
}

.goal-card-actions .goal-add-funds:hover {
  background: var(--success-green);
  color: #ffffff;
}

.goal-card-actions .goal-edit {
  background: var(--accent-muted);
  color: var(--accent-primary);
}

.goal-card-actions .goal-edit:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.goal-card-actions .goal-delete {
  background: var(--danger-muted);
  color: var(--danger-red);
}

.goal-card-actions .goal-delete:hover {
  background: var(--danger-red);
  color: #ffffff;
}

.no-goals-message,
.goals-error-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ================================
   PAYCHECK DETAILS MODAL
   ================================ */
.paycheck-detail-header {
  text-align: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border-color);
}

.paycheck-detail-header h3 {
  font-size: 1.25rem;
  margin: 0 0 0.375rem 0;
  color: var(--text-primary);
}

.paycheck-date-range {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.paycheck-section {
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin: 0 0 0.75rem 0;
}

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

.menu-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.875rem;
  transition: border-color var(--transition-fast);
}

.menu-item:hover {
  border-color: var(--border-hover);
}

.menu-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.item-name {
  font-weight: 500;
  color: var(--text-primary);
}

.item-amount {
  font-weight: 600;
  font-size: 1rem;
}

.income-amount {
  color: var(--success-green);
}

.bill-amount {
  color: var(--danger-red);
}

.menu-item-date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.no-items {
  color: var(--text-secondary);
  font-style: italic;
  padding: 0.875rem;
  text-align: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.paycheck-summary {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

.summary-row.total {
  font-size: 1rem;
  font-weight: 600;
  padding-top: 0.75rem;
  color: var(--accent-primary);
}

.net-amount {
  font-size: 1.125rem !important;
  font-weight: 700 !important;
}

/* ================================
   GROCERY MANAGER
   ================================ */
.grocery-container {
  padding: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.grocery-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.grocery-tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
  white-space: nowrap;
  margin-bottom: -1px;
}

.grocery-tab:hover {
  color: var(--text-primary);
}

.grocery-tab-active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.grocery-section {
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  animation: fadeIn 0.25s ease;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.section-header h3 {
  margin: 0;
  font-size: 1.125rem;
  color: var(--text-primary);
}

.form-container {
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  margin-bottom: 0;
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

#recipe-form.form-container {
  padding: 1.25rem;
  margin: 0;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2000;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Ingredients list */
.ingredients-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.625rem;
}

.ingredient-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color var(--transition-fast);
}

.ingredient-item:hover {
  border-color: var(--border-hover);
}

.ingredient-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.ingredient-details {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.ingredient-actions {
  display: flex;
  gap: 0.375rem;
  margin-top: auto;
}

.ingredient-actions button {
  flex: 1;
  padding: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

/* Recipe list */
.recipe-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.875rem;
}

.recipe-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  transition: border-color var(--transition-fast);
}

.recipe-item:hover {
  border-color: var(--border-hover);
}

.recipe-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.recipe-ingredients {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.recipe-actions {
  display: flex;
  gap: 0.375rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.recipe-actions button {
  flex: 1;
  padding: 0.375rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

/* ================================
   GROCERY DASHBOARD & STAT CARDS
   ================================ */
.grocery-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.grocery-stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

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

.grocery-stat-card .stat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.grocery-stat-card .stat-icon.ingredients {
  background: var(--accent-muted);
  color: var(--accent-primary);
}

.grocery-stat-card .stat-icon.recipes {
  background: var(--success-muted);
  color: var(--success-green);
}

.grocery-stat-card .stat-icon.spend {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning-orange);
}

.grocery-stat-card .stat-icon.restock {
  background: var(--danger-muted);
  color: var(--danger-red);
}

.grocery-stat-card .stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.grocery-stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.grocery-stat-card .stat-value.warning {
  color: var(--warning-orange);
}

.grocery-stat-card .stat-value.danger {
  color: var(--danger-red);
}

/* ================================
   GROCERY BUDGET TRACKER
   ================================ */
.grocery-budget-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.grocery-budget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.grocery-budget-header h4 {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.grocery-budget-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.grocery-budget-input input {
  width: 100px;
  padding: 0.375rem 0.5rem;
  font-size: 0.8125rem;
}

.grocery-budget-progress {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.grocery-budget-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease, background 0.3s ease;
}

.grocery-budget-bar.safe {
  background: var(--success-green);
}

.grocery-budget-bar.warning {
  background: var(--warning-orange);
}

.grocery-budget-bar.danger {
  background: var(--danger-red);
}

.grocery-budget-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.grocery-budget-text .warning {
  color: var(--warning-orange);
  font-weight: 600;
}

.grocery-budget-text .danger {
  color: var(--danger-red);
  font-weight: 600;
}

.meal-planning-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr auto;
  gap: 1rem;
  align-items: end;
}

.meal-plan-input label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
  font-weight: 500;
}

.meal-plan-input input {
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.input-with-prefix {
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding-left: 0.625rem;
}

.input-with-prefix span {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.input-with-prefix input {
  border: none;
  background: transparent;
  padding-left: 0.25rem;
}

.meal-plan-summary {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.meal-plan-summary .summary-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
}

.meal-plan-summary .summary-label {
  color: var(--text-secondary);
}

.meal-plan-summary .summary-value {
  font-weight: 600;
  color: var(--success-green);
}

.meal-plan-summary .placeholder-text {
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-align: center;
}

@media (max-width: 768px) {
  .meal-planning-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  
  .meal-plan-summary {
    grid-column: span 2;
  }
}

/* ================================
   INGREDIENT CARDS
   ================================ */
.ingredient-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.ingredient-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.ingredient-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.ingredient-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.ingredient-card .card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.ingredient-card .card-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--success-green);
}

.ingredient-card .card-unit {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}

.ingredient-card .category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.category-badge.produce { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.category-badge.dairy { background: rgba(59, 158, 237, 0.15); color: #3b9eed; }
.category-badge.meat-seafood { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.category-badge.dry-goods { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.category-badge.canned-goods { background: rgba(168, 162, 158, 0.15); color: #a8a29e; }
.category-badge.oils-condiments { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.category-badge.spices-seasonings { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.category-badge.frozen { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.category-badge.bakery { background: rgba(251, 146, 60, 0.15); color: #fb923c; }
.category-badge.other { background: var(--bg-tertiary); color: var(--text-secondary); }

.ingredient-card .stock-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.ingredient-card .stock-toggle label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.ingredient-card .stock-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.ingredient-card .stock-indicator {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
}

.stock-indicator.in-stock {
  background: var(--success-muted);
  color: var(--success-green);
}

.stock-indicator.needs-restock {
  background: var(--danger-muted);
  color: var(--danger-red);
}

.ingredient-card .card-actions {
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.ingredient-card:hover .card-actions {
  opacity: 1;
}

.ingredient-card .card-actions button {
  padding: 0.375rem 0.5rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.ingredient-card .card-actions .edit-btn {
  background: var(--accent-muted);
  color: var(--accent-primary);
}

.ingredient-card .card-actions .edit-btn:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.ingredient-card .card-actions .delete-btn {
  background: var(--danger-muted);
  color: var(--danger-red);
}

.ingredient-card .card-actions .delete-btn:hover {
  background: var(--danger-red);
  color: #ffffff;
}

/* ================================
   INGREDIENTS SHEET TABLE STYLE
   ================================ */
.ingredients-sheet .section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.ingredients-sheet .header-stats {
  display: flex;
  gap: 0.5rem;
  flex: 1;
}

.stat-pill {
  background: var(--bg-tertiary);
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.stat-pill.warning {
  background: var(--warning-muted);
  color: var(--warning-orange);
}

.sheet-toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.sheet-toolbar .search-box {
  flex: 1;
  min-width: 200px;
}

.sheet-toolbar .search-box input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.sheet-toolbar .filter-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.875rem;
  min-width: 140px;
}

.inline-form {
  background: var(--card-bg);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.inline-form form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.inline-form input,
.inline-form select {
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.8125rem;
}

.inline-form input[type="text"] {
  flex: 1;
  min-width: 120px;
}

.inline-checkbox {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.inline-checkbox input {
  width: 16px;
  height: 16px;
}

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

.sheet-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.sheet-table th {
  background: var(--bg-tertiary);
  padding: 0.75rem 0.625rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.sheet-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.sheet-table th.sortable:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.sheet-table td {
  padding: 0.625rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.sheet-table tr:hover {
  background: var(--bg-tertiary);
}

.sheet-table tr.need-restock {
  background: rgba(239, 68, 68, 0.05);
}

.sheet-table tr.need-restock:hover {
  background: rgba(239, 68, 68, 0.1);
}

.sheet-table .empty-row td {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
}

.sheet-table .col-checkbox {
  width: 40px;
  text-align: center;
}

.sheet-table .col-checkbox input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.sheet-table .col-name {
  min-width: 140px;
  font-weight: 500;
}

.sheet-table .col-category {
  min-width: 110px;
}

.sheet-table .col-price {
  text-align: right;
  font-weight: 600;
  color: var(--success-green);
}

.sheet-table .col-unit {
  color: var(--text-secondary);
}

.sheet-table .col-stock {
  min-width: 100px;
}

.sheet-table .col-actions {
  width: 90px;
  text-align: center;
}

.category-tag {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
}

.stock-toggle-btn {
  padding: 0.25rem 0.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.stock-toggle-btn.in-stock {
  background: var(--success-muted);
  color: var(--success-green);
}

.stock-toggle-btn.need-buy {
  background: var(--danger-muted);
  color: var(--danger-red);
}

.stock-toggle-btn:hover {
  opacity: 0.8;
}

.action-btn {
  padding: 0.25rem 0.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-btn.edit-btn {
  background: var(--accent-muted);
  color: var(--accent-primary);
}

.action-btn.delete-btn {
  background: var(--danger-muted);
  color: var(--danger-red);
}

.action-btn:hover {
  opacity: 0.8;
}

.sheet-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bulk-actions .btn-danger {
  background: var(--danger-muted);
  color: var(--danger-red);
}

.table-info {
  font-size: 0.75rem;
}

/* ================================
   FREQUENTLY BOUGHT SECTION
   ================================ */
.frequently-bought-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.frequently-bought-section h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.frequently-bought-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.frequently-bought-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.frequently-bought-item:hover {
  border-color: var(--accent-primary);
  background: var(--accent-muted);
}

.frequently-bought-item .usage-count {
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  background: var(--accent-muted);
  color: var(--accent-primary);
  border-radius: 999px;
  font-weight: 600;
}

/* ================================
   RECIPE CARDS
   ================================ */
.recipe-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.recipe-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all var(--transition-normal);
}

.recipe-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.recipe-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.recipe-card .card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.recipe-card .card-cost {
  font-size: 1rem;
  font-weight: 700;
  color: var(--success-green);
}

.recipe-card .ingredients-list {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.recipe-card .ingredients-list span {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin: 0.125rem;
}

.recipe-card .card-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.recipe-card .card-actions button {
  flex: 1;
  padding: 0.5rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.recipe-card .card-actions .edit-btn {
  background: var(--accent-muted);
  color: var(--accent-primary);
}

.recipe-card .card-actions .edit-btn:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.recipe-card .card-actions .delete-btn {
  background: var(--danger-muted);
  color: var(--danger-red);
}

.recipe-card .card-actions .delete-btn:hover {
  background: var(--danger-red);
  color: #ffffff;
}

/* ================================
   SHOPPING LIST ENHANCED
   ================================ */
.shopping-list-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.shopping-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.shopping-list-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
}

.shopping-list-stats .stat {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.shopping-list-stats .stat-label {
  color: var(--text-secondary);
}

.shopping-list-stats .stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

.shopping-list-stats .stat-value.total {
  color: var(--success-green);
}

.shopping-category-group {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.shopping-category-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

.shopping-category-header .category-count {
  font-size: 0.6875rem;
  padding: 0.125rem 0.5rem;
  background: var(--accent-muted);
  color: var(--accent-primary);
  border-radius: 999px;
}

.shopping-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

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

.shopping-item:hover {
  background: var(--bg-tertiary);
}

.shopping-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.shopping-item .item-details {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shopping-item .item-name {
  font-size: 0.9375rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.shopping-item .item-quantity {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.shopping-item .item-price {
  font-weight: 600;
  color: var(--success-green);
  font-size: 0.875rem;
}

.shopping-item.purchased {
  opacity: 0.6;
  background: var(--bg-tertiary);
}

.shopping-item.purchased .item-name {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.clear-purchased-btn {
  padding: 0.5rem 1rem;
  background: var(--danger-muted);
  color: var(--danger-red);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.clear-purchased-btn:hover {
  background: var(--danger-red);
  color: #ffffff;
}

/* ================================
   GROCERY FILTER CONTROLS
   ================================ */
.grocery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.grocery-filter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.grocery-filter-item label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.grocery-filter-item select {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.grocery-filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.grocery-filter-toggle:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.grocery-filter-toggle.active {
  background: var(--accent-muted);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.grocery-filter-toggle input {
  width: 16px;
  height: 16px;
}

/* Shopping list */
.shopping-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.shopping-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.shopping-item:hover {
  border-color: var(--border-hover);
}

.shopping-item.checked {
  opacity: 0.6;
}

.shopping-item.checked .shopping-name {
  text-decoration: line-through;
}

.shopping-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.shopping-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.shopping-quantity {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

/* Receipt scanner */
.receipt-scanner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
}

.receipt-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.receipt-preview {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}


/* ================================
   RESPONSIVE - Mobile
   ================================ */
@media (max-width: 768px) {
  .app-content {
    padding: 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.875rem;
    padding-top: 3rem;
  }

  .page-header h1 {
    font-size: 1.25rem;
  }

  .page-header-actions {
    width: 100%;
    flex-direction: column;
  }

  .page-header-actions button {
    width: 100%;
  }

  .search-container {
    right: 0.75rem;
    width: 160px;
  }

  .search-container input {
    font-size: 0.75rem;
    padding: 0.375rem 0.625rem;
  }

  .calendar-grid {
    gap: 1px;
  }

  .calendar-day {
    min-height: 64px;
    padding: 0.375rem;
  }

  .day-number {
    font-size: 0.75rem;
  }

  .calendar-day-net .net-income,
  .calendar-day-net .net-expense {
    font-size: 0.5625rem;
  }

  .day-balance {
    font-size: 0.5rem;
  }

  .indicator-dot {
    width: 5px;
    height: 5px;
  }

  .modal-content {
    padding: 1.25rem;
    width: 95%;
    max-width: 95vw;
    max-height: 90vh;
  }
  
  .modal-content h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    padding-right: 2rem;
  }
  
  .modal-content input,
  .modal-content select,
  .modal-content textarea {
    font-size: 16px !important;
    padding: 0.875rem !important;
    min-height: 48px;
    width: 100% !important;
    box-sizing: border-box;
  }
  
  .modal-content label {
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
  }
  
  .modal-content .settings-form > div {
    margin-bottom: 1rem;
  }
  
  .modal-content div[style*="grid-template-columns: 1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }
  
  .modal-content .btn,
  .modal-content .btn-primary {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    min-height: 48px;
    width: 100%;
  }
  
  .modal-content div[style*="display: flex; gap: 1rem"] {
    flex-direction: column;
  }

  .transactions-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .transactions-filters select,
  .transactions-filters input[type="date"] {
    max-width: 100%;
    width: 100%;
  }

  .transaction-item {
    grid-template-columns: 1fr;
    gap: 0.625rem;
  }

  .tx-date {
    order: 1;
    font-size: 0.6875rem;
  }

  .tx-info {
    order: 2;
  }

  .tx-amount {
    order: 3;
    text-align: left;
  }

  .tx-actions {
    order: 4;
    justify-content: flex-end;
  }

  .budget-summary {
    flex-direction: column;
  }

  .budget-summary-card {
    min-width: 100%;
  }

  .budget-category-header {
    flex-wrap: wrap;
  }

  .budget-category-actions {
    width: 100%;
    margin-top: 0.5rem;
  }

  .budget-category-actions button {
    flex: 1;
  }

  .reports-filters {
    flex-direction: column;
  }

  .reports-filters select {
    width: 100%;
  }

  .accounts-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.625rem;
  }

  .account-card-item {
    padding: 0.875rem;
    gap: 0.625rem;
  }

  .account-card-balance {
    font-size: 1.125rem;
    padding: 0.5rem 0;
  }

  .bills-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.625rem;
  }

  .bill-card-item {
    padding: 0.75rem;
    gap: 0.5rem;
  }

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

@media (max-width: 480px) {
  .auth-container {
    padding: 1.25rem;
    max-width: 95vw;
  }

  .auth-header h1 {
    font-size: 1.25rem;
  }

  .page-header h1 {
    font-size: 1.125rem;
  }

  .card-value {
    font-size: 1.5rem;
  }

  .calendar-controls {
    flex-wrap: wrap;
    gap: 0.375rem;
  }

  .calendar-controls button {
    padding: 0.375rem 0.625rem !important;
    font-size: 0.6875rem !important;
    flex: 1;
    min-width: 40px;
  }

  #calendar-month-label {
    font-size: 1rem;
    width: 100%;
    order: -1;
    margin-bottom: 0.25rem;
  }

  .calendar-weekdays {
    padding: 0.375rem 2px;
    font-size: 0.5625rem;
    gap: 1px;
  }

  .weekday {
    padding: 0.25rem;
    font-size: 0.5rem;
  }

  .calendar-grid {
    gap: 1px;
  }

  .calendar-day {
    min-height: 48px;
    padding: 0.25rem;
    gap: 0.125rem;
  }

  .day-number {
    font-size: 0.6875rem;
  }

  .calendar-day-net .net-income,
  .calendar-day-net .net-expense {
    font-size: 0.5rem;
  }

  .day-balance {
    font-size: 0.4375rem;
  }

  .indicator-dot {
    width: 4px;
    height: 4px;
  }

  .calendar-day {
    min-height: 48px;
    padding: 0.1875rem 0.25rem;
  }

  .settings-section {
    padding: 1.25rem;
  }

  .accounts-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .bills-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
  }

  .bill-card-item {
    padding: 0.625rem;
    gap: 0.375rem;
  }

  .transaction-item {
    padding: 0.75rem;
  }

  .tx-description {
    font-size: 0.8125rem;
  }

  .tx-amount {
    font-size: 0.9375rem;
  }

  .tx-actions button {
    padding: 0.25rem 0.5rem;
    font-size: 0.625rem;
  }

  .grocery-tabs {
    gap: 0;
  }

  .grocery-tab {
    padding: 0.5rem 0.625rem;
    font-size: 0.75rem;
  }

  .grocery-dashboard {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .grocery-stat-card {
    padding: 0.75rem;
  }

  .grocery-stat-card .stat-value {
    font-size: 1.25rem;
  }

  .grocery-stat-card .stat-label {
    font-size: 0.625rem;
  }

  .grocery-budget-section {
    padding: 0.875rem;
  }

  .grocery-budget-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .grocery-budget-input {
    width: 100%;
  }

  .grocery-budget-input input {
    flex: 1;
  }

  .ingredient-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }

  .ingredient-card {
    padding: 0.875rem;
  }

  .ingredient-card .card-title {
    font-size: 0.9375rem;
  }

  .ingredient-card .card-price {
    font-size: 1rem;
  }

  .ingredient-card .card-actions {
    opacity: 1;
    position: static;
    justify-content: flex-end;
    margin-top: 0.5rem;
  }

  .recipe-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .recipe-card {
    padding: 1rem;
  }

  .frequently-bought-section {
    padding: 0.875rem;
  }

  .frequently-bought-list {
    gap: 0.375rem;
  }

  .frequently-bought-item {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
  }

  .grocery-filters {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.625rem;
  }

  .grocery-filter-item {
    width: 100%;
  }

  .grocery-filter-item select {
    flex: 1;
  }

  .shopping-list-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .shopping-list-stats {
    width: 100%;
    justify-content: space-between;
  }

  .shopping-category-header {
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
  }

  .shopping-item {
    padding: 0.625rem 0.75rem;
  }

  .shopping-item .item-name {
    font-size: 0.875rem;
  }
}

/* ================================
   DEBTS VIEW
   ================================ */
.debts-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}

.debts-summary-card {
  flex: 1;
  min-width: 140px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  text-align: center;
}

.debts-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.debts-value {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.debts-value-red {
  color: var(--danger-red);
}

.section-title-debts {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
}

.debts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.875rem;
  margin-bottom: 2rem;
}

.debt-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  transition: border-color var(--transition-fast);
}

.debt-card:hover {
  border-color: var(--border-hover);
}

.debt-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.debt-icon {
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-muted);
  color: var(--accent-primary);
  border-radius: var(--radius-md);
  letter-spacing: 0.02em;
}

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

.debt-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 0.125rem;
}

.debt-type {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.debt-rate {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.debt-rate.rate-high {
  background: var(--danger-muted);
  color: var(--danger-red);
}

.debt-rate.rate-medium {
  background: rgba(255, 171, 0, 0.15);
  color: var(--warning-orange);
}

.debt-rate.rate-low {
  background: var(--success-muted);
  color: var(--success-green);
}

.debt-balance-container {
  text-align: center;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.debt-balance {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--danger-red);
}

.debt-balance-label {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.debt-progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.debt-progress-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.debt-progress-fill {
  height: 100%;
  background: var(--success-green);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.debt-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.debt-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.debt-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
}

.debt-detail-label {
  color: var(--text-tertiary);
}

.debt-detail-value {
  color: var(--text-primary);
  font-weight: 500;
}

.debt-card-actions {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.debt-card-actions button {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.debt-card-actions .debt-payment-btn {
  background: var(--success-muted);
  color: var(--success-green);
}

.debt-card-actions .debt-payment-btn:hover {
  background: var(--success-green);
  color: #ffffff;
}

.debt-card-actions .debt-edit {
  background: var(--accent-muted);
  color: var(--accent-primary);
}

.debt-card-actions .debt-edit:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.debt-card-actions .debt-delete {
  background: var(--danger-muted);
  color: var(--danger-red);
}

.debt-card-actions .debt-delete:hover {
  background: var(--danger-red);
  color: #ffffff;
}

.debt-countdown {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 0.875rem;
  border-left: 3px solid var(--accent-primary);
}

.debt-countdown.countdown-green {
  border-left-color: var(--success-green);
}

.debt-countdown.countdown-yellow {
  border-left-color: var(--warning-orange);
}

.debt-countdown.countdown-red {
  border-left-color: var(--danger-red);
}

.countdown-header {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
}

.countdown-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.625rem;
}

.countdown-date {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.countdown-green .countdown-date {
  color: var(--success-green);
}

.countdown-yellow .countdown-date {
  color: var(--warning-orange);
}

.countdown-red .countdown-date {
  color: var(--danger-red);
}

.countdown-months {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.countdown-green .countdown-months {
  color: var(--success-green);
}

.countdown-yellow .countdown-months {
  color: var(--warning-orange);
}

.countdown-red .countdown-months {
  color: var(--danger-red);
}

.countdown-progress {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.countdown-progress-bar {
  height: 4px;
  background: var(--bg-primary);
  border-radius: 2px;
  overflow: hidden;
}

.countdown-progress-fill {
  height: 100%;
  background: var(--success-green);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.countdown-progress-text {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  text-align: right;
}

.no-debts-message,
.debts-error-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Debt Analysis Section */
.debt-analysis-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1rem;
}

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

.analysis-header h3 {
  margin: 0;
  font-size: 1.125rem;
  color: var(--text-primary);
}

.analysis-extra-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.analysis-extra-container label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.analysis-extra-container input {
  width: 100px;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.analysis-extra-container input:focus {
  border-color: var(--accent-primary);
  outline: none;
}

.analysis-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.analysis-tab {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.analysis-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.analysis-tab-active {
  background: var(--accent-muted);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.analysis-content {
  min-height: 150px;
}

.analysis-empty,
.analysis-error {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.analysis-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.analysis-stat {
  flex: 1;
  min-width: 120px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.analysis-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.analysis-stat-label {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.analysis-stat-savings {
  background: var(--success-muted);
}

.analysis-stat-savings .analysis-stat-value {
  color: var(--success-green);
}

.analysis-payoff-order {
  margin-bottom: 1.5rem;
}

.analysis-payoff-order h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
}

.payoff-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.payoff-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-primary);
}

.payoff-order {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

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

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

.payoff-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.payoff-details {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.payoff-date {
  text-align: right;
  flex-shrink: 0;
}

.payoff-months {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.payoff-date-text {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.analysis-methodology {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.analysis-methodology h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin: 0 0 0.5rem 0;
}

.analysis-methodology p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Checkbox Row */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.checkbox-row label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Responsive Debts */
@media (max-width: 768px) {
  .debts-summary {
    flex-direction: column;
  }
  
  .debts-summary-card {
    min-width: 100%;
  }
  
  .debts-grid {
    grid-template-columns: 1fr;
  }
  
  .analysis-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .analysis-tabs {
    flex-wrap: wrap;
  }
  
  .analysis-summary {
    flex-direction: column;
  }
  
  .debt-card-actions {
    grid-template-columns: 1fr;
  }
}

/* ================================
   FINANCIAL HEALTH SCORE
   ================================ */
:root {
  --health-red: #ef4444;
  --health-orange: #f59e0b;
  --health-yellow: #eab308;
  --health-green: #22c55e;
}

.health-score-section {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-lg);
}

.health-score-main {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.health-score-circle-container {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.health-score-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.health-score-bg {
  fill: none;
  stroke: var(--bg-elevated);
  stroke-width: 8;
}

.health-score-progress {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 1s ease-out, stroke 0.3s ease;
}

.health-score-progress.score-red {
  stroke: var(--health-red);
}

.health-score-progress.score-orange {
  stroke: var(--health-orange);
}

.health-score-progress.score-yellow {
  stroke: var(--health-yellow);
}

.health-score-progress.score-green {
  stroke: var(--health-green);
}

.health-score-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.health-score-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.health-score-grade {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-top: 0.25rem;
}

.health-score-grade.grade-red {
  color: var(--health-red);
}

.health-score-grade.grade-orange {
  color: var(--health-orange);
}

.health-score-grade.grade-yellow {
  color: var(--health-yellow);
}

.health-score-grade.grade-green {
  color: var(--health-green);
}

.health-score-info {
  flex: 1;
}

.health-score-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.health-score-trend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.health-score-trend .trend-icon {
  font-size: 1rem;
}

.health-score-trend.trend-improving {
  color: var(--health-green);
}

.health-score-trend.trend-declining {
  color: var(--health-red);
}

.health-score-trend.trend-stable {
  color: var(--text-secondary);
}

.health-score-factors {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.health-factor-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.875rem;
  transition: border-color var(--transition-fast);
}

.health-factor-card:hover {
  border-color: var(--border-hover);
}

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

.health-factor-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.health-factor-status {
  font-size: 0.875rem;
}

.health-factor-status.status-good::before {
  content: "✓";
  color: var(--health-green);
}

.health-factor-status.status-warning::before {
  content: "!";
  color: var(--health-orange);
  font-weight: bold;
}

.health-factor-status.status-critical::before {
  content: "✗";
  color: var(--health-red);
}

.health-factor-score {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.health-factor-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.health-factor-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease-out;
}

.health-factor-bar-fill.bar-good {
  background: var(--health-green);
}

.health-factor-bar-fill.bar-warning {
  background: var(--health-orange);
}

.health-factor-bar-fill.bar-critical {
  background: var(--health-red);
}

.health-factor-tip {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.4;
}

.health-factor-detail {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
  font-style: italic;
}

.health-score-empty {
  text-align: center;
  padding: 2rem 1rem;
}

.health-score-empty .empty-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
}

.health-score-empty p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0;
}

@keyframes scoreReveal {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.health-score-section.animate-in {
  animation: scoreReveal 0.4s ease-out;
}

@media (max-width: 640px) {
  .health-score-main {
    flex-direction: column;
    text-align: center;
  }
  
  .health-score-info {
    text-align: center;
  }
  
  .health-score-trend {
    justify-content: center;
  }
  
  .health-score-factors {
    grid-template-columns: 1fr;
  }
  
  .health-score-circle-container {
    width: 100px;
    height: 100px;
  }
  
  .health-score-value {
    font-size: 1.75rem;
  }
}

/* ================================
   QUICK ADD FLOATING ACTION BUTTON
   ================================ */
.quick-add-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
}

.fab-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(59, 158, 237, 0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(59, 158, 237, 0.5);
}

.fab-button.active {
  background: var(--accent-secondary);
  transform: rotate(45deg);
}

.fab-icon {
  transition: transform 0.3s ease;
  font-weight: 300;
  line-height: 1;
}

.fab-menu {
  position: absolute;
  bottom: 70px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.fab-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fab-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 2rem;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
}

.fab-menu-item:hover {
  background: var(--accent-primary);
  color: white;
  transform: translateX(-5px);
  border-color: var(--accent-primary);
}

.fab-menu-icon {
  font-size: 1rem;
}

/* Quick Add Modal Specific Styles */
.quick-add-modal-content {
  max-width: 400px;
  width: 90%;
}

.quick-add-modal-content .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.quick-add-modal-content .modal-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.quick-add-modal-content .close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color var(--transition-fast);
}

.quick-add-modal-content .close-btn:hover {
  color: var(--text-primary);
}

.quick-add-modal-content .form-group {
  margin-bottom: 1rem;
}

.quick-add-modal-content .form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.quick-add-modal-content .form-group input,
.quick-add-modal-content .form-group select {
  width: 100%;
}

.full-width {
  width: 100%;
}

/* Quick Add Toast Notification */
.quick-add-toast {
  position: fixed;
  bottom: 6rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.875rem 1.5rem;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.quick-add-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.quick-add-toast.success {
  background: rgba(34, 197, 94, 0.15);
  border-left: 4px solid var(--success-green);
}

.quick-add-toast.error {
  background: rgba(239, 68, 68, 0.15);
  border-left: 4px solid var(--danger-red);
}

/* Quick Add Button States */
.btn-saving {
  opacity: 0.8;
  cursor: not-allowed;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-success {
  background: var(--success-green) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-checkmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  animation: checkmark-pop 0.3s ease-out;
}

@keyframes checkmark-pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Mobile Responsive FAB */
@media (max-width: 640px) {
  .quick-add-fab {
    bottom: 1.5rem;
    right: 1.5rem;
  }
  
  .fab-button {
    width: 52px;
    height: 52px;
    font-size: 24px;
  }
  
  .fab-menu {
    bottom: 65px;
  }
  
  .fab-menu-item {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
  }
  
  .quick-add-modal-content {
    width: 95%;
    max-width: none;
    margin: 1rem;
  }
  
  .quick-add-toast {
    bottom: 5rem;
    width: 90%;
    max-width: 320px;
    text-align: center;
  }
}

/* ================================
   SPENDING INSIGHTS SECTION
   ================================ */
.insights-section {
  margin-top: 2rem;
  padding: 0;
}

.insights-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.insights-summary {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.insight-summary-card {
  flex: 1;
  min-width: 100px;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.insight-summary-card .summary-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.insight-summary-card .summary-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.insight-summary-card.positive {
  border-left: 3px solid #9b59b6;
}

.insight-summary-card.positive .summary-count {
  color: #9b59b6;
}

.insight-summary-card.warning {
  border-left: 3px solid var(--warning-orange);
}

.insight-summary-card.warning .summary-count {
  color: var(--warning-orange);
}

.insight-summary-card.opportunity {
  border-left: 3px solid var(--success-green);
}

.insight-summary-card.opportunity .summary-count {
  color: var(--success-green);
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.insight-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.insight-card.trend {
  border-left: 4px solid var(--accent-primary);
}

.insight-card.warning {
  border-left: 4px solid var(--warning-orange);
}

.insight-card.opportunity {
  border-left: 4px solid var(--success-green);
}

.insight-card.achievement {
  border-left: 4px solid #9b59b6;
}

.insight-card.pattern {
  border-left: 4px solid #00bcd4;
}

.insight-card.top {
  border-left: 4px solid #ff9800;
}

.insight-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.insight-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.insight-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

.insight-metric {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.insight-metric-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.insight-metric-change {
  font-size: 0.8125rem;
  font-weight: 500;
}

.insight-metric-change.positive {
  color: var(--success-green);
}

.insight-metric-change.negative {
  color: var(--danger-red);
}

.insight-action {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.insight-action .action-label {
  color: var(--accent-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.insight-action .action-label:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

/* Mobile Responsive Insights */
@media (max-width: 640px) {
  .insights-summary {
    gap: 0.5rem;
  }
  
  .insight-summary-card {
    min-width: 70px;
    padding: 0.75rem 0.5rem;
  }
  
  .insight-summary-card .summary-count {
    font-size: 1.25rem;
  }
  
  .insight-summary-card .summary-label {
    font-size: 0.625rem;
  }
  
  .insights-grid {
    grid-template-columns: 1fr;
  }
  
  .insight-card {
    padding: 1rem;
  }
  
  .insight-icon {
    font-size: 1.25rem;
  }
  
  .insight-title {
    font-size: 0.9rem;
  }
  
  .insight-description {
    font-size: 0.8125rem;
  }
}

/* ================================
   FORECAST VIEW
   ================================ */
.forecast-period-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 4px;
  width: fit-content;
}

.forecast-period-btn {
  padding: 0.5rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.forecast-period-btn:hover {
  color: var(--text-primary);
}

.forecast-period-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
}

.forecast-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.forecast-current-balance {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.forecast-current-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.forecast-current-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.forecast-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.forecast-summary-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
}

.forecast-summary-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  display: block;
}

.forecast-summary-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

.forecast-summary-value.positive {
  color: var(--success-green);
}

.forecast-summary-value.negative {
  color: var(--danger-red);
}

.forecast-summary-value.income {
  color: var(--success-green);
}

.forecast-summary-value.expense {
  color: var(--danger-red);
}

.forecast-summary-date {
  color: var(--text-tertiary);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.forecast-warnings-section {
  background: var(--danger-muted);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.forecast-warnings-section h3 {
  color: var(--danger-red);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.forecast-warnings-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.forecast-warning-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.forecast-warning-card.critical {
  border-left: 4px solid var(--danger-red);
}

.forecast-warning-card.warning {
  border-left: 4px solid var(--warning-orange);
}

.forecast-warning-card .warning-date {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 100px;
}

.forecast-warning-card .warning-message {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.forecast-chart-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
}

.forecast-chart-section h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text-primary);
}

.forecast-chart {
  height: 250px;
  display: flex;
  gap: 0.5rem;
}

.forecast-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  padding-right: 0.5rem;
  min-width: 70px;
}

.forecast-chart-area {
  flex: 1;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.forecast-zero-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--danger-red);
  opacity: 0.5;
  z-index: 1;
}

.forecast-bars {
  display: flex;
  align-items: flex-end;
  height: 100%;
  gap: 1px;
  padding: 0 2px;
}

.forecast-bar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.forecast-bar-container:hover {
  opacity: 0.8;
}

.forecast-bar-container:hover .forecast-bar {
  background: var(--accent-primary);
}

.forecast-bar {
  width: 100%;
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: background var(--transition-fast);
}

.forecast-bar.danger {
  background: linear-gradient(180deg, var(--danger-red), #b91c1c);
}

.forecast-bar.warning {
  background: linear-gradient(180deg, var(--warning-orange), #d97706);
}

.forecast-bar.payday {
  background: linear-gradient(180deg, var(--success-green), #16a34a);
}

.forecast-event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid var(--card-bg);
  position: absolute;
  top: 4px;
  z-index: 2;
}

.forecast-x-axis {
  display: flex;
  justify-content: space-between;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  padding-top: 0.5rem;
  margin-left: 78px;
}

.forecast-tooltip {
  position: absolute;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: none;
  z-index: 100;
  transform: translateX(-50%) translateY(-100%);
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  min-width: 160px;
}

.forecast-tooltip .tooltip-date {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.forecast-tooltip .tooltip-balance {
  color: var(--text-primary);
  font-size: 0.875rem;
}

.forecast-tooltip .tooltip-income {
  color: var(--success-green);
  font-size: 0.8125rem;
}

.forecast-tooltip .tooltip-expense {
  color: var(--danger-red);
  font-size: 0.8125rem;
}

.forecast-tooltip .tooltip-events {
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.forecast-events-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.forecast-events-section h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text-primary);
}

.forecast-events-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.forecast-event-row {
  display: grid;
  grid-template-columns: 100px 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.forecast-event-row .event-date {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.forecast-event-row .event-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.forecast-event-row .event-tag {
  background: var(--accent-muted);
  color: var(--accent-primary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
}

.forecast-event-row .event-amounts {
  display: flex;
  gap: 0.5rem;
}

.forecast-event-row .event-income {
  color: var(--success-green);
  font-weight: 500;
  font-size: 0.875rem;
}

.forecast-event-row .event-expense {
  color: var(--danger-red);
  font-weight: 500;
  font-size: 0.875rem;
}

.forecast-event-row .event-balance {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  min-width: 90px;
  text-align: right;
}

.forecast-no-events {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.forecast-error {
  text-align: center;
  padding: 2rem;
  color: var(--danger-red);
}

.forecast-chart-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

/* Mobile Responsive Forecast */
@media (max-width: 768px) {
  .forecast-period-selector {
    width: 100%;
  }
  
  .forecast-period-btn {
    flex: 1;
    text-align: center;
  }
  
  .forecast-summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .forecast-event-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .forecast-event-row .event-balance {
    text-align: left;
  }
  
  .forecast-chart {
    height: 200px;
  }
  
  .forecast-y-axis {
    min-width: 50px;
    font-size: 0.625rem;
  }
  
  .forecast-x-axis {
    margin-left: 58px;
    font-size: 0.625rem;
  }
}

@media (max-width: 480px) {
  .forecast-summary-cards {
    grid-template-columns: 1fr;
  }
  
  .forecast-current-value {
    font-size: 1.5rem;
  }
  
  .forecast-summary-value {
    font-size: 1.25rem;
  }
}

/* ================================
   BILL REMINDERS WIDGET
   ================================ */
.reminders-widget {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1rem;
}

.reminders-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.reminders-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.reminders-summary {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.summary-badge {
  font-size: 0.6875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: 600;
}

.summary-badge.overdue {
  background: var(--danger-muted);
  color: var(--danger-red);
}

.summary-badge.due-today {
  background: rgba(243, 156, 18, 0.15);
  color: #f39c12;
}

.summary-badge.total {
  background: var(--accent-muted);
  color: var(--accent-primary);
}

.reminders-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 350px;
  overflow-y: auto;
}

.reminders-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  color: var(--text-tertiary);
}

.reminders-empty .empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--success-green);
}

.reminders-empty p {
  margin: 0;
  font-size: 0.875rem;
}

.reminder-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border-left: 4px solid transparent;
  transition: all var(--transition-fast);
}

.reminder-card:hover {
  background: var(--bg-tertiary);
}

.reminder-card.overdue {
  border-left-color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
}

.reminder-card.due-today {
  border-left-color: #f39c12;
  background: rgba(243, 156, 18, 0.1);
}

.reminder-card.due-soon {
  border-left-color: var(--accent-primary);
}

.reminder-card.upcoming {
  border-left-color: #27ae60;
}

.reminder-card.pulse {
  animation: pulse-overdue 2s ease-in-out infinite;
}

@keyframes pulse-overdue {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.2);
  }
}

.reminder-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

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

.reminder-details {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.reminder-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reminder-frequency {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: capitalize;
}

.reminder-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}

.reminder-amount {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--danger-red);
}

.reminder-countdown {
  font-size: 0.6875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.reminder-countdown.overdue {
  background: #e74c3c;
  color: white;
}

.reminder-countdown.due-today {
  background: #f39c12;
  color: white;
}

.reminder-countdown.due-soon {
  background: var(--accent-primary);
  color: white;
}

.reminder-countdown.upcoming {
  background: rgba(39, 174, 96, 0.2);
  color: #27ae60;
}

.reminders-see-all {
  margin-top: 1rem;
  text-align: center;
}

.reminders-see-all-btn {
  width: 100%;
  padding: 0.625rem 1rem;
}

.all-reminders-list {
  margin-top: 1rem;
  max-height: 400px;
  overflow-y: auto;
}

/* Mobile Responsive Reminders */
@media (max-width: 480px) {
  .reminders-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .reminder-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .reminder-right {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ================================
   ACHIEVEMENTS STYLES
   ================================ */
.achievements-summary {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}

.achievement-progress-circle {
  width: 120px;
  height: 120px;
  position: relative;
  flex-shrink: 0;
}

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

.achievement-progress-circle .progress-bg {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 8;
}

.achievement-progress-circle .progress-fill {
  fill: none;
  stroke: #f1c40f;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.achievement-progress-circle .progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: column;
}

.achievement-progress-circle .progress-count {
  font-size: 1.75rem;
  font-weight: 700;
  color: #f1c40f;
  line-height: 1;
}

.achievement-progress-circle .progress-total {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
}

.achievements-info {
  flex: 1;
}

.achievements-info h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.achievements-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.next-achievement {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-tertiary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
}

.next-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.next-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.next-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}

.next-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--success-green));
  transition: width 0.5s ease;
}

.next-percent {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-primary);
  white-space: nowrap;
}

.achievements-categories {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.achievement-category {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.achievement-category h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.achievement-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: default;
}

.achievement-badge.earned {
  border-color: #f1c40f;
  background: rgba(241, 196, 15, 0.08);
  box-shadow: 0 0 20px rgba(241, 196, 15, 0.1);
}

.achievement-badge.locked {
  opacity: 0.6;
  filter: grayscale(40%);
}

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

.achievement-badge.earned:hover {
  box-shadow: 0 4px 20px rgba(241, 196, 15, 0.2);
}

.achievement-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.achievement-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
  font-size: 0.9375rem;
}

.achievement-description {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.achievement-requirement {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  background: var(--bg-tertiary);
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.achievement-progress {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  margin-top: 0.75rem;
  overflow: hidden;
}

.achievement-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--success-green));
  transition: width 0.5s ease;
}

.achievement-progress-text {
  font-size: 0.6875rem;
  color: var(--accent-primary);
  margin-top: 0.375rem;
  font-weight: 600;
}

.achievement-date {
  font-size: 0.6875rem;
  color: #f1c40f;
  margin-top: 0.5rem;
  font-weight: 500;
}

.achievements-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem;
  text-align: center;
}

.achievements-error .error-icon {
  font-size: 2.5rem;
}

.achievements-error p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Achievement Celebration Overlay */
.achievement-celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.achievement-celebration-overlay.visible {
  opacity: 1;
}

.achievement-celebration {
  background: var(--card-bg);
  border: 2px solid #f1c40f;
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  text-align: center;
  position: relative;
  max-width: 400px;
  width: 90%;
  transform: scale(0.8);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.achievement-celebration-overlay.visible .achievement-celebration {
  transform: scale(1);
  animation: celebrationBounce 0.5s ease;
}

@keyframes celebrationBounce {
  0% { transform: scale(0.5); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.celebration-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.celebration-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: particleFall 2s ease-out forwards;
}

@keyframes particleFall {
  0% {
    transform: translateY(-100%) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(500%) rotate(720deg);
    opacity: 0;
  }
}

.celebration-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: iconPulse 1s ease infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.achievement-celebration h2 {
  color: #f1c40f;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.achievement-celebration h3 {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.achievement-celebration p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
}

.celebration-close {
  background: #f1c40f;
  color: #000;
  font-weight: 700;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.celebration-close:hover {
  background: #f39c12;
  transform: translateY(-2px);
}

/* Mobile Responsive Achievements */
@media (max-width: 768px) {
  .achievements-summary {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
    padding: 1.25rem;
  }

  .achievement-progress-circle {
    width: 100px;
    height: 100px;
  }

  .achievement-progress-circle .progress-count {
    font-size: 1.5rem;
  }

  .next-achievement {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .next-progress-bar {
    width: 100%;
    order: 3;
  }

  .achievement-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .achievement-badge {
    padding: 1rem;
  }

  .achievement-icon {
    font-size: 2rem;
  }

  .achievement-name {
    font-size: 0.875rem;
  }

  .achievement-description {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .achievement-category {
    padding: 1rem;
  }

  .achievement-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .achievement-badge {
    padding: 0.875rem;
  }

  .achievement-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
  }

  .achievement-name {
    font-size: 0.8125rem;
  }

  .achievement-description {
    display: none;
  }

  .achievement-celebration {
    padding: 2rem 1.5rem;
  }

  .celebration-icon {
    font-size: 3rem;
  }

  .achievement-celebration h2 {
    font-size: 1.25rem;
  }

  .achievement-celebration h3 {
    font-size: 1rem;
  }
}

/* ================================
   SUBSCRIPTIONS VIEW
   ================================ */
.subscription-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.subscription-summary .summary-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  text-align: center;
}

.subscription-summary .summary-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.subscription-summary .summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.subscription-categories {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.subscription-categories h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text-primary);
}

.category-bar {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.category-bar:last-child {
  margin-bottom: 0;
}

.category-info {
  min-width: 120px;
  flex-shrink: 0;
}

.category-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.category-count {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  display: block;
}

.category-bar-wrapper {
  flex: 1;
  height: 24px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.category-bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--accent-primary), var(--success-green));
  transition: width 0.5s ease;
}

.category-amount {
  min-width: 100px;
  text-align: right;
  flex-shrink: 0;
}

.category-amount .amount {
  font-weight: 600;
  color: var(--accent-primary);
  font-size: 0.875rem;
  display: block;
}

.category-amount .percentage {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.subscription-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.subscription-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: border-color var(--transition-fast);
}

.subscription-card:hover {
  border-color: var(--border-hover);
}

.subscription-delete-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  border: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}

.subscription-card:hover .subscription-delete-btn {
  opacity: 1;
}

.subscription-delete-btn:hover {
  background: rgba(231, 76, 60, 0.3);
}

@media (hover: none) and (pointer: coarse) {
  .subscription-delete-btn {
    opacity: 1;
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
  }
}

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

.subscription-icon {
  font-size: 2rem;
  line-height: 1;
}

.subscription-category-badge {
  font-size: 0.6875rem;
  padding: 0.25rem 0.5rem;
  background: var(--accent-muted);
  color: var(--accent-primary);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.subscription-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.subscription-amount {
  font-size: 1.25rem;
  color: var(--accent-primary);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.subscription-amount .frequency {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-left: 0.25rem;
}

.subscription-details {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

.subscription-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
}

.subscription-meta .meta-label {
  color: var(--text-tertiary);
}

.subscription-meta .meta-value {
  color: var(--text-secondary);
  font-weight: 500;
}

.subscription-meta .meta-value.renewal-today {
  color: var(--danger-red);
  font-weight: 600;
}

.subscription-meta .meta-value.renewal-soon {
  color: var(--warning-orange);
  font-weight: 600;
}

.subscription-meta .meta-value.renewal-week {
  color: var(--text-primary);
}

.subscription-tips {
  background: var(--accent-muted);
  border: 1px solid rgba(59, 158, 237, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 2rem;
}

.subscription-tips h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text-primary);
}

.subscription-tips ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.subscription-tips li {
  margin-bottom: 0.625rem;
  padding-left: 1.25rem;
  position: relative;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.subscription-tips li:last-child {
  margin-bottom: 0;
}

.subscription-tips li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent-primary);
}

.subscription-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.subscription-empty .empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.subscription-empty h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.subscription-empty p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.subscription-error {
  text-align: center;
  padding: 2rem;
  color: var(--danger-red);
}

.no-categories {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  text-align: center;
  padding: 1rem;
}

/* Mobile Responsive Subscriptions */
@media (max-width: 768px) {
  .subscription-summary {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .subscription-summary .summary-card {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
  }

  .subscription-summary .summary-value {
    font-size: 1.25rem;
  }

  .category-bar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .category-info {
    min-width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }

  .category-bar-wrapper {
    flex: 0 0 100%;
    order: 3;
    height: 16px;
  }

  .category-amount {
    min-width: auto;
  }

  .subscription-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .subscription-categories {
    padding: 1rem;
  }

  .subscription-card {
    padding: 1rem;
  }

  .subscription-icon {
    font-size: 1.5rem;
  }

  .subscription-name {
    font-size: 1rem;
  }

  .subscription-amount {
    font-size: 1.125rem;
  }

  .subscription-tips {
    padding: 1rem;
  }

  .subscription-tips li {
    font-size: 0.8125rem;
  }
}

/* ================================
   NET WORTH VIEW
   ================================ */
.networth-hero {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}

.networth-amount {
  font-size: 3rem;
  font-weight: 700;
  color: var(--success-green);
  margin-bottom: 0.5rem;
}

.networth-amount.negative {
  color: var(--danger-red);
}

.networth-trend {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.networth-trend .up {
  color: var(--success-green);
}

.networth-trend .down {
  color: var(--danger-red);
}

.networth-message {
  font-size: 0.9375rem;
  color: var(--text-tertiary);
  font-style: italic;
}

.networth-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.breakdown-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.breakdown-section.assets {
  border-left: 4px solid var(--success-green);
}

.breakdown-section.liabilities {
  border-left: 4px solid var(--danger-red);
}

.breakdown-section h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-size: 1rem;
}

.breakdown-total {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.breakdown-section.assets .breakdown-total {
  color: var(--success-green);
}

.breakdown-section.liabilities .breakdown-total {
  color: var(--danger-red);
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.breakdown-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.breakdown-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.breakdown-item-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breakdown-item-type {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: capitalize;
}

.breakdown-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  flex: 1;
  min-width: 60px;
  max-width: 100px;
}

.breakdown-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.breakdown-bar-fill.asset {
  background: var(--success-green);
}

.breakdown-bar-fill.liability {
  background: var(--danger-red);
}

.breakdown-item-amount {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.125rem;
  min-width: 70px;
}

.breakdown-item-amount .amount {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.breakdown-item-amount .percentage {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.breakdown-empty {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-tertiary);
}

.breakdown-empty .empty-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.breakdown-empty p {
  font-size: 0.875rem;
  margin: 0;
}

.networth-chart-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.networth-chart-section h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-size: 1rem;
}

.networth-chart {
  height: 250px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 1rem 0;
}

.chart-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.chart-bar-container {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar-container.has-negative {
  align-items: center;
}

.chart-bar {
  width: 100%;
  background: linear-gradient(180deg, var(--success-green), rgba(34, 197, 94, 0.3));
  border-radius: 4px 4px 0 0;
  transition: all 0.3s ease;
  min-height: 4px;
}

.chart-bar:hover {
  background: var(--accent-primary);
  transform: scaleY(1.05);
}

.chart-bar-negative {
  width: 100%;
  background: linear-gradient(0deg, var(--danger-red), rgba(239, 68, 68, 0.3));
  border-radius: 0 0 4px 4px;
  transition: all 0.3s ease;
  min-height: 4px;
}

.chart-bar-negative:hover {
  background: var(--danger-red);
  transform: scaleY(1.05);
}

.chart-label {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  margin-top: 0.5rem;
  text-align: center;
}

.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-tertiary);
}

.chart-empty .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.chart-empty p {
  font-size: 0.875rem;
  margin: 0;
}

.networth-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--danger-red);
}

.networth-error .error-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.networth-error p {
  font-size: 0.9375rem;
  margin: 0;
}

/* Mobile Responsive Net Worth */
@media (max-width: 768px) {
  .networth-hero {
    padding: 1.5rem;
  }

  .networth-amount {
    font-size: 2.25rem;
  }

  .networth-trend {
    font-size: 1rem;
  }

  .networth-breakdown {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .breakdown-section {
    padding: 1.25rem;
  }

  .breakdown-total {
    font-size: 1.5rem;
  }

  .breakdown-item {
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
  }

  .breakdown-bar {
    display: none;
  }

  .networth-chart {
    height: 180px;
    gap: 2px;
  }

  .chart-label {
    font-size: 0.625rem;
  }
}

@media (max-width: 480px) {
  .networth-amount {
    font-size: 1.875rem;
  }

  .breakdown-section {
    padding: 1rem;
  }

  .breakdown-total {
    font-size: 1.25rem;
  }

  .breakdown-item {
    padding: 0.625rem;
  }

  .breakdown-item-name {
    font-size: 0.875rem;
  }

  .breakdown-item-amount .amount {
    font-size: 0.875rem;
  }

  .networth-chart {
    height: 150px;
  }
}

/* =========================================
   UI POLISH - Micro-animations & Visual Feedback
   ========================================= */

/* ================================
   SMOOTH SCROLL & SCROLLBAR STYLES
   ================================ */
html {
  scroll-behavior: smooth;
}

.scrollable,
.app-content,
.modal-content,
.sidebar-nav {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) var(--bg-secondary);
}

.scrollable::-webkit-scrollbar,
.app-content::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.scrollable::-webkit-scrollbar-track,
.app-content::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

.scrollable::-webkit-scrollbar-thumb,
.app-content::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 4px;
}

.scrollable::-webkit-scrollbar-thumb:hover,
.app-content::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

/* ================================
   ENHANCED CARD HOVER EFFECTS
   ================================ */
.card,
.summary-card,
.account-card-item,
.debt-card,
.goal-card-item,
.dashboard-card,
.budget-category-item,
.budget-summary-card,
.reports-summary-card,
.subscription-card,
.achievement-badge,
.bill-card-item,
.transaction-item,
.settings-section {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color var(--transition-fast);
}

.card:hover,
.summary-card:hover,
.account-card-item:hover,
.debt-card:hover,
.goal-card-item:hover,
.dashboard-card-clickable:hover,
.budget-category-item:hover,
.subscription-card:hover,
.bill-card-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* ================================
   BUTTON ENHANCEMENTS
   ================================ */
.btn,
.btn-primary,
.btn-secondary,
.btn-nav,
.auth-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.15s ease;
}

.btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-nav:active,
.auth-btn:active {
  transform: scale(0.97);
}

.btn::after,
.btn-primary::after,
.btn-secondary::after,
.btn-nav::after,
.auth-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  transform: scale(0);
  opacity: 0;
  transition: transform 0.5s, opacity 0.3s;
  pointer-events: none;
}

.btn:active::after,
.btn-primary:active::after,
.btn-secondary:active::after,
.btn-nav:active::after,
.auth-btn:active::after {
  transform: scale(2);
  opacity: 1;
  transition: transform 0s;
}

/* ================================
   ENHANCED FORM FOCUS STATES
   ================================ */
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 158, 237, 0.2);
  transition: all 0.2s ease;
}

/* ================================
   ENHANCED MODAL ANIMATIONS
   ================================ */
.modal {
  transition: opacity 0.3s ease;
}

.modal.modal-visible {
  animation: modalFadeIn 0.3s ease;
}

.modal-content {
  animation: modalScaleIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScaleIn {
  from { 
    transform: scale(0.9); 
    opacity: 0; 
  }
  to { 
    transform: scale(1); 
    opacity: 1; 
  }
}

/* ================================
   LOADING SKELETON STYLES
   ================================ */
.skeleton {
  background: linear-gradient(90deg, 
    var(--bg-secondary) 25%, 
    var(--bg-tertiary) 50%, 
    var(--bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-text-sm {
  height: 0.75rem;
  width: 60%;
}

.skeleton-title {
  height: 1.5rem;
  width: 40%;
  margin-bottom: 1rem;
}

.skeleton-card {
  padding: 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.skeleton-value {
  height: 2rem;
  width: 50%;
  margin-bottom: 0.5rem;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-button {
  height: 2.5rem;
  width: 100px;
  border-radius: var(--radius-md);
}

.skeleton-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 0.5rem;
}

/* Dashboard Skeleton */
.dashboard-skeleton {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-skeleton .skeleton-card {
  min-height: 100px;
}

/* Transaction List Skeleton */
.transaction-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.transaction-skeleton-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

/* Account Cards Skeleton */
.accounts-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.875rem;
}

.account-skeleton-card {
  padding: 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  min-height: 150px;
}

/* ================================
   ANIMATED NUMBER COUNTER
   ================================ */
@keyframes countUp {
  from { 
    opacity: 0; 
    transform: translateY(10px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.animated-number {
  animation: countUp 0.5s ease forwards;
}

/* ================================
   TOAST NOTIFICATIONS
   ================================ */
@keyframes slideInRight {
  from { 
    transform: translateX(100%); 
    opacity: 0; 
  }
  to { 
    transform: translateX(0); 
    opacity: 1; 
  }
}

@keyframes slideOutRight {
  from { 
    transform: translateX(0); 
    opacity: 1; 
  }
  to { 
    transform: translateX(100%); 
    opacity: 0; 
  }
}

.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  animation: slideInRight 0.3s ease forwards;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toast.hiding {
  animation: slideOutRight 0.3s ease forwards;
}

.toast-success {
  border-left: 3px solid var(--success-green);
}

.toast-error {
  border-left: 3px solid var(--danger-red);
}

.toast-warning {
  border-left: 3px solid var(--warning-orange);
}

.toast-info {
  border-left: 3px solid var(--accent-primary);
}

.toast-message {
  color: var(--text-primary);
  font-size: 0.875rem;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.25rem;
  line-height: 1;
  transition: color var(--transition-fast);
}

.toast-close:hover {
  color: var(--text-primary);
}

/* ================================
   PROGRESS BAR ANIMATIONS
   ================================ */
.progress-fill,
.budget-progress-fill,
.goal-progress-fill,
.achievement-progress-fill,
.next-progress-fill {
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================
   STAGGERED LIST ANIMATION
   ================================ */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  animation: staggerIn 0.4s ease forwards;
}

@keyframes staggerIn {
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }
.stagger-item:nth-child(7) { animation-delay: 0.35s; }
.stagger-item:nth-child(8) { animation-delay: 0.4s; }
.stagger-item:nth-child(9) { animation-delay: 0.45s; }
.stagger-item:nth-child(10) { animation-delay: 0.5s; }

/* ================================
   ATTENTION PULSE ANIMATION
   ================================ */
@keyframes pulse-scale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.attention-pulse {
  animation: pulse-scale 2s ease-in-out infinite;
}

/* ================================
   GRADIENT TEXT
   ================================ */
.gradient-text {
  background: linear-gradient(90deg, var(--accent-primary), var(--success-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ================================
   ICON ANIMATIONS
   ================================ */
.icon-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.icon-bounce {
  animation: bounce 0.5s ease;
}

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

.icon-shake {
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.icon-pop {
  animation: pop 0.3s ease;
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ================================
   ENHANCED SIDEBAR NAVIGATION
   ================================ */
.nav-item {
  border-left: 3px solid transparent;
  margin-left: 0;
  padding-left: calc(0.875rem - 3px);
}

.nav-item:hover {
  background: rgba(59, 158, 237, 0.1);
  border-left-color: var(--accent-primary);
}

.nav-item-active {
  background: rgba(59, 158, 237, 0.15);
  border-left-color: var(--accent-primary);
}

.nav-item-active:hover {
  background: rgba(59, 158, 237, 0.2);
}

/* ================================
   EMPTY STATE STYLES
   ================================ */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-tertiary);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

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

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.empty-state-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ================================
   HIGHLIGHT/GLOW EFFECTS
   ================================ */
.highlight-glow {
  animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 5px var(--accent-primary),
                0 0 10px var(--accent-primary);
  }
  to {
    box-shadow: 0 0 10px var(--accent-primary),
                0 0 20px var(--accent-primary);
  }
}

/* ================================
   SUCCESS/ERROR FEEDBACK
   ================================ */
.success-flash {
  animation: successFlash 0.5s ease;
}

@keyframes successFlash {
  0% { background-color: transparent; }
  50% { background-color: var(--success-muted); }
  100% { background-color: transparent; }
}

.error-flash {
  animation: errorFlash 0.5s ease;
}

@keyframes errorFlash {
  0% { background-color: transparent; }
  50% { background-color: var(--danger-muted); }
  100% { background-color: transparent; }
}

/* ================================
   LOADING STATES
   ================================ */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 25, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: inherit;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-dots {
  display: flex;
  gap: 0.375rem;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: loadingDots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0; }

@keyframes loadingDots {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ================================
   ENTRY ANIMATIONS
   ================================ */
.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

.slide-in-up {
  animation: slideInUp 0.3s ease forwards;
}

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

.slide-in-left {
  animation: slideInLeft 0.3s ease forwards;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.scale-in {
  animation: scaleIn 0.3s ease forwards;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ================================
   INTERACTIVE HOVER STATES
   ================================ */
.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.hover-scale {
  transition: transform 0.2s ease;
}

.hover-scale:hover {
  transform: scale(1.02);
}

.hover-bright {
  transition: filter 0.2s ease;
}

.hover-bright:hover {
  filter: brightness(1.1);
}

/* ================================
   MOBILE RESPONSIVENESS - ANIMATIONS
   ================================ */
@media (max-width: 768px) {
  .card:hover,
  .summary-card:hover,
  .account-card-item:hover,
  .debt-card:hover,
  .goal-card-item:hover,
  .dashboard-card-clickable:hover,
  .budget-category-item:hover,
  .subscription-card:hover,
  .bill-card-item:hover,
  .hover-lift:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  .stagger-item {
    animation-duration: 0.2s;
  }

  .stagger-item:nth-child(n) {
    animation-delay: 0.02s;
  }

  .toast {
    left: 1rem;
    right: 1rem;
    width: auto;
  }

  @keyframes slideInRight {
    from { 
      transform: translateY(-100%); 
      opacity: 0; 
    }
    to { 
      transform: translateY(0); 
      opacity: 1; 
    }
  }

  @keyframes slideOutRight {
    from { 
      transform: translateY(0); 
      opacity: 1; 
    }
    to { 
      transform: translateY(-100%); 
      opacity: 0; 
    }
  }
}

@media (max-width: 480px) {
  .empty-state {
    padding: 2rem 1rem;
  }

  .empty-state-icon {
    font-size: 3rem;
  }

  .empty-state-title {
    font-size: 1.125rem;
  }

  .empty-state-text {
    font-size: 0.875rem;
  }
}

/* ================================
   iOS SMOOTH SCROLLING
   ================================ */
@supports (-webkit-overflow-scrolling: touch) {
  .app-content,
  .modal-content,
  .sidebar-nav {
    -webkit-overflow-scrolling: touch;
  }
}

/* ================================
   TOUCH DEVICE OPTIMIZATIONS
   ================================ */
@media (hover: none) and (pointer: coarse) {
  .card:hover,
  .summary-card:hover,
  .account-card-item:hover,
  .debt-card:hover,
  .goal-card-item:hover,
  .dashboard-card-clickable:hover,
  .budget-category-item:hover,
  .subscription-card:hover,
  .bill-card-item:hover,
  .hover-lift:hover,
  .hover-scale:hover {
    transform: none;
    box-shadow: none;
  }

  .nav-item:hover {
    background: transparent;
    border-left-color: transparent;
  }

  .nav-item:active {
    background: rgba(59, 158, 237, 0.1);
  }

  .nav-item-active:hover {
    background: rgba(59, 158, 237, 0.15);
    border-left-color: var(--accent-primary);
  }

  .btn:active::after,
  .btn-primary:active::after,
  .btn-secondary:active::after,
  .btn-nav:active::after,
  .auth-btn:active::after {
    display: none;
  }
}

/* ================================
   BUDGET ALERTS SYSTEM
   ================================ */
.alerts-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.alert-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  animation: slideInDown 0.3s ease-out;
}

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

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

.alert-content {
  flex: 1;
  min-width: 0;
}

.alert-message {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.alert-detail {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}

.alert-progress {
  width: 60px;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.alert-progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.view-all-alerts-btn {
  background: var(--accent-muted);
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  text-align: center;
}

.view-all-alerts-btn:hover {
  background: var(--accent-primary);
  color: white;
}

.alerts-modal {
  max-width: 500px;
  width: 90%;
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 60vh;
  overflow-y: auto;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  animation: fadeIn 0.2s ease-out;
}

.alert-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.no-alerts {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-secondary);
}

.no-alerts p {
  margin-top: 1rem;
  font-size: 1rem;
}

.alert-badge-nav {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--danger-red);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  animation: pulse-scale 2s infinite;
}

/* ================================
   DATA VISUALIZATION - TREND CHARTS
   ================================ */
.trend-chart-container {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.trend-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.trend-chart-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.trend-chart-period {
  display: flex;
  gap: 0.5rem;
}

.trend-period-btn {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.trend-period-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.trend-period-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.trend-chart {
  height: 200px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 1rem 0;
}

.trend-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.trend-bars {
  display: flex;
  gap: 2px;
  height: 160px;
  align-items: flex-end;
}

.trend-bar {
  width: 12px;
  border-radius: 3px 3px 0 0;
  transition: height 0.5s ease;
  position: relative;
}

.trend-bar.income {
  background: var(--success-green);
}

.trend-bar.expense {
  background: var(--danger-red);
}

.trend-bar:hover::after {
  content: attr(data-value);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  white-space: nowrap;
  z-index: 10;
  box-shadow: var(--shadow-md);
}

.trend-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-align: center;
}

.trend-legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.trend-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.trend-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.trend-legend-dot.income {
  background: var(--success-green);
}

.trend-legend-dot.expense {
  background: var(--danger-red);
}

/* ================================
   IMPORT/EXPORT UI
   ================================ */
.import-export-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.import-export-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.import-export-title {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.import-export-actions {
  display: flex;
  gap: 0.75rem;
}

.import-btn, .export-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.import-btn {
  background: var(--accent-muted);
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
}

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

.export-btn {
  background: var(--success-muted);
  border: 1px solid var(--success-green);
  color: var(--success-green);
}

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

.import-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.import-dropzone:hover,
.import-dropzone.dragover {
  border-color: var(--accent-primary);
  background: var(--accent-muted);
}

.import-dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.import-dropzone-text {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.import-dropzone-hint {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.import-preview {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  max-height: 200px;
  overflow-y: auto;
}

.import-preview-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
}

.import-preview-row:last-child {
  border-bottom: none;
}

.import-preview-header {
  font-weight: 600;
  color: var(--text-primary);
}

/* ================================
   SMART CATEGORIZATION
   ================================ */
.category-suggestion {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--accent-muted);
  border-radius: var(--radius-md);
  margin-top: 0.5rem;
  animation: fadeIn 0.2s ease-out;
}

.category-suggestion-icon {
  font-size: 1rem;
}

.category-suggestion-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.category-suggestion-accept {
  margin-left: auto;
  padding: 0.25rem 0.5rem;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}

/* ================================
   THEME TOGGLE ENHANCED
   ================================ */
.theme-toggle-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.theme-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.theme-toggle-options {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.theme-option-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-option-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.theme-option-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

/* ================================
   DASHBOARD WIDGETS
   ================================ */
.dashboard-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dashboard-widget {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  transition: all var(--transition-fast);
}

.dashboard-widget:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.widget-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.widget-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.widget-value.positive {
  color: var(--success-green);
}

.widget-value.negative {
  color: var(--danger-red);
}

.widget-trend {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.widget-trend.up {
  color: var(--success-green);
}

.widget-trend.down {
  color: var(--danger-red);
}

.widget-mini-chart {
  height: 40px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  margin-top: 0.75rem;
}

.widget-mini-bar {
  flex: 1;
  background: var(--accent-muted);
  border-radius: 2px 2px 0 0;
  transition: height 0.3s ease;
}

.widget-mini-bar:last-child {
  background: var(--accent-primary);
}

/* ================================
   SKELETON LOADING ANIMATIONS
   ================================ */
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 1rem;
  border-radius: var(--radius-sm);
}

.skeleton-text-sm {
  height: 0.75rem;
  border-radius: var(--radius-sm);
}

.skeleton-text-lg {
  height: 1.5rem;
  border-radius: var(--radius-sm);
}

.skeleton-card {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-lg);
  min-height: 80px;
}

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-value {
  display: inline-block;
  width: 80px;
  height: 1.75rem;
}

.skeleton-detail {
  display: inline-block;
  width: 140px;
  height: 0.875rem;
  margin-top: 0.25rem;
}

.skeleton-pressure-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.skeleton-pressure-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.skeleton-pressure-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.skeleton-calendar-day {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
  min-height: 90px;
}

.skeleton-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.skeleton-summary-value {
  display: inline-block;
  width: 70px;
  height: 1.25rem;
}

.skeleton-health-score {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.skeleton-health-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
}

.skeleton-health-factors {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.skeleton-factor-card {
  height: 80px;
  border-radius: var(--radius-md);
}

.skeleton-fade-out {
  animation: skeletonFadeOut 0.3s ease forwards;
}

@keyframes skeletonFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ================================
   MICRO-INTERACTIONS & POLISH
   Smooth animations for better UX
   ================================ */

/* Theme Switching - Smooth color transitions */
html {
  transition: 
    background-color 0.3s ease,
    color 0.3s ease;
}

html *,
html *::before,
html *::after {
  transition: 
    background-color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    color 0.2s ease;
}

html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: 
    background-color 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease,
    color 0.3s ease !important;
}

/* Enhanced Sidebar Nav Hover Effects */
.nav-item {
  transition: 
    all 0.15s cubic-bezier(0.4, 0, 0.2, 1),
    padding-left 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.nav-item:hover {
  padding-left: calc(0.875rem + 4px);
  background: var(--bg-tertiary);
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  background: var(--accent-primary);
  border-radius: 0 2px 2px 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item:hover::before {
  transform: translateY(-50%) scaleY(1);
}

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

/* Card Hover Lift Effects */
.dashboard-card,
.bill-card-item,
.account-card,
.settings-section,
.recipe-card,
.shopping-list-card,
.debt-card,
.goal-card,
.transaction-card,
.insight-summary-card {
  transition: 
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.15s ease;
}

.dashboard-card:hover:not(#dash-end-balance-card),
.bill-card-item:hover,
.account-card:hover,
.recipe-card:hover,
.shopping-list-card:hover,
.debt-card:hover,
.goal-card:hover,
.transaction-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Settings section subtle hover */
.settings-section:hover {
  border-color: var(--border-hover);
}

/* Button Press Effects - Subtle scale on active */
.btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-nav:active,
.auth-btn:active,
.add-transaction-btn:active,
.fab-menu-item:active,
.logout-btn:active,
.menu-btn:active {
  transform: scale(0.97);
  transition-duration: 0.05s;
}

.btn-primary:active,
.auth-btn:active,
.add-transaction-btn:active {
  box-shadow: none;
}

/* Bill card action buttons */
.bill-card-actions button:active,
.rec-edit:active,
.rec-delete:active {
  transform: scale(0.95);
}

/* Stagger Animation for List Items */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(15px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Apply stagger to list items */
.pressure-list li,
.bills-card-grid .bill-card-item,
.accounts-grid .account-card,
.transaction-item,
.fab-menu-item {
  animation: fadeInUp 0.3s ease-out backwards;
}

.pressure-list li:nth-child(1),
.bills-card-grid .bill-card-item:nth-child(1),
.accounts-grid .account-card:nth-child(1) { animation-delay: 0.05s; }

.pressure-list li:nth-child(2),
.bills-card-grid .bill-card-item:nth-child(2),
.accounts-grid .account-card:nth-child(2) { animation-delay: 0.1s; }

.pressure-list li:nth-child(3),
.bills-card-grid .bill-card-item:nth-child(3),
.accounts-grid .account-card:nth-child(3) { animation-delay: 0.15s; }

.pressure-list li:nth-child(4),
.bills-card-grid .bill-card-item:nth-child(4),
.accounts-grid .account-card:nth-child(4) { animation-delay: 0.2s; }

.pressure-list li:nth-child(5),
.bills-card-grid .bill-card-item:nth-child(5),
.accounts-grid .account-card:nth-child(5) { animation-delay: 0.25s; }

.pressure-list li:nth-child(6),
.bills-card-grid .bill-card-item:nth-child(6),
.accounts-grid .account-card:nth-child(6) { animation-delay: 0.3s; }

/* FAB Menu stagger animation */
.fab-menu.active .fab-menu-item:nth-child(1) { animation-delay: 0s; }
.fab-menu.active .fab-menu-item:nth-child(2) { animation-delay: 0.05s; }
.fab-menu.active .fab-menu-item:nth-child(3) { animation-delay: 0.1s; }
.fab-menu.active .fab-menu-item:nth-child(4) { animation-delay: 0.15s; }

/* Dashboard cards stagger */
.dashboard-container .dashboard-card {
  animation: fadeInUp 0.35s ease-out backwards;
}

.dashboard-container .dashboard-card:nth-child(1) { animation-delay: 0.05s; }
.dashboard-container .dashboard-card:nth-child(2) { animation-delay: 0.1s; }
.dashboard-container .dashboard-card:nth-child(3) { animation-delay: 0.15s; }
.dashboard-container .dashboard-card:nth-child(4) { animation-delay: 0.2s; }
.dashboard-container .dashboard-card:nth-child(5) { animation-delay: 0.25s; }

/* Accordion Expand/Collapse Animations */
.accordion-content,
.collapsible-content,
.expandable-content {
  overflow: hidden;
  transition: 
    max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease,
    padding 0.25s ease;
}

.accordion-content.collapsed,
.collapsible-content.collapsed,
.expandable-content.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.accordion-content.expanded,
.collapsible-content.expanded,
.expandable-content.expanded {
  max-height: 1000px;
  opacity: 1;
}

/* Accordion trigger rotate icon */
.accordion-trigger,
.collapsible-trigger {
  transition: transform 0.25s ease;
}

.accordion-trigger.expanded .accordion-icon,
.collapsible-trigger.expanded .collapsible-icon {
  transform: rotate(180deg);
}

/* Enhanced Modal Animations */
@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

.modal-visible {
  animation: modalFadeIn 0.2s ease-out;
}

.modal-visible .modal-content {
  animation: modalSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-closing {
  animation: modalFadeIn 0.15s ease-out reverse forwards;
}

.modal-closing .modal-content {
  animation: modalSlideOut 0.15s ease-in forwards;
}

/* FAB Button Bounce Animation */
@keyframes fabBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes fabPulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(59, 158, 237, 0.4);
  }
  50% {
    box-shadow: 0 6px 20px rgba(59, 158, 237, 0.6);
  }
}

.fab-button {
  animation: fabPulse 3s ease-in-out infinite;
}

.fab-button:hover {
  animation: fabBounce 0.4s ease-in-out;
}

.fab-button.active {
  animation: none;
}

/* Subtle FAB attention animation on page load */
@keyframes fabEntrance {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(20px);
  }
  60% {
    opacity: 1;
    transform: scale(1.1) translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.quick-add-fab {
  animation: fabEntrance 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards;
}

/* Enhanced View Switch Animation */
@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-active {
  animation: viewFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Calendar day hover enhancement */
.calendar-day:not(.calendar-day-empty) {
  transition: 
    all 0.15s ease,
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.calendar-day:not(.calendar-day-empty):hover {
  transform: scale(1.02);
  z-index: 1;
}

/* Smooth Scroll for Calendar Navigation */
.calendar-container,
.calendar-grid,
.app-content {
  scroll-behavior: smooth;
}

/* Today indicator pulse animation */
@keyframes todayPulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(59, 158, 237, 0.15);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(59, 158, 237, 0.08);
  }
}

.calendar-day-today {
  animation: todayPulse 2.5s ease-in-out infinite;
}

/* Search results dropdown animation */
.search-results.active {
  animation: fadeInUp 0.2s ease-out;
}

/* Sidebar slide animation enhancement */
.sidebar {
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.active {
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

/* Sidebar overlay fade */
.sidebar-overlay {
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Input focus animation */
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px var(--accent-muted);
}

/* Transaction/List item hover slide */
.pressure-list li,
.transaction-item.clickable,
.detail-income,
.detail-expense {
  transition: 
    background 0.15s ease,
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    padding-left 0.2s ease;
}

.pressure-list li:hover,
.detail-income:hover,
.detail-expense:hover {
  transform: translateX(4px);
}

/* Toast notification enhanced animation */
@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.quick-add-toast.show {
  animation: toastSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Tab/pill hover states */
.auth-tab {
  transition: 
    all 0.2s ease,
    transform 0.15s ease;
}

.auth-tab:hover:not(.auth-tab-active) {
  transform: translateY(-1px);
}

.auth-tab-active {
  box-shadow: 0 2px 8px rgba(59, 158, 237, 0.3);
}


/* Loading shimmer enhancement */
@keyframes shimmerEnhanced {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Checkbox and toggle animations */
.theme-toggle-slider::before {
  transition: 
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.2s ease;
}

/* Badge pop animation */
@keyframes badgePop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.transaction-badge,
.today-badge,
.projected-badge,
.recurring-badge,
.category-badge {
  animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

/* Number value count-up animation helper */
.animate-value {
  transition: transform 0.3s ease;
}

.animate-value.counting {
  transform: scale(1.05);
}

/* Hover glow effect for interactive elements */
.nav-item:hover,
.fab-button:hover,
.btn-primary:hover {
  filter: brightness(1.05);
}

/* Disabled reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .fab-button {
    animation: none !important;
  }
  
  .calendar-day-today {
    animation: none !important;
  }
}

/* ================================
   DANGER ZONE - Settings
   ================================ */
.settings-danger-zone {
  border: 1px solid var(--danger-red);
  background: var(--danger-muted);
}

.settings-danger-zone h3 {
  color: var(--danger-red);
}

.danger-zone-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.btn-danger {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  background: var(--danger-red);
  color: #ffffff;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-danger:active {
  transform: scale(0.97);
  box-shadow: none;
}

/* ================================
   AI ADVISOR CHAT INTERFACE
   ================================ */
.view-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  margin-top: -0.5rem;
}

.ai-chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 400px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-message {
  display: flex;
  gap: 0.75rem;
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

.user-message {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.assistant-message {
  align-self: flex-start;
}

.ai-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: var(--accent-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border: 1px solid var(--border-color);
}

.ai-message-content {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.6;
}

.user-message .ai-message-content {
  background: var(--accent-primary);
  color: #ffffff;
  border-bottom-right-radius: var(--radius-sm);
}

.assistant-message .ai-message-content {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-bottom-left-radius: var(--radius-sm);
}

.ai-welcome-message {
  display: flex;
  gap: 0.75rem;
}

.ai-welcome-message .ai-message-content {
  background: var(--bg-tertiary);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-sm);
}

.ai-welcome-message ul {
  margin: 0.75rem 0;
  padding-left: 1.25rem;
}

.ai-welcome-message li {
  margin: 0.375rem 0;
  color: var(--text-secondary);
}

.ai-welcome-message p {
  margin: 0.5rem 0;
  color: var(--text-primary);
}

.ai-suggestions {
  list-style: none;
  padding: 0;
  margin-top: 0.75rem;
}

.ai-suggestions li {
  background: var(--bg-elevated);
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  margin: 0.375rem 0;
  font-style: italic;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ai-suggestions li:hover {
  background: var(--accent-muted);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.ai-chat-form {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.ai-chat-form input {
  flex: 1;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.ai-chat-form input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.ai-chat-form input::placeholder {
  color: var(--text-tertiary);
}

.ai-chat-form input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#ai-send-btn {
  padding: 0.875rem 1.25rem;
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1.125rem;
  font-weight: 600;
  transition: background var(--transition-fast), transform var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

#ai-send-btn:hover:not(:disabled) {
  background: var(--accent-secondary);
  transform: translateY(-1px);
}

#ai-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.send-icon {
  font-size: 1.25rem;
}

.typing-indicator .ai-message-content {
  padding: 1rem 1.25rem;
}

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--text-tertiary);
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

@media (max-width: 600px) {
  .ai-chat-container {
    height: calc(100vh - 180px);
    border-radius: var(--radius-md);
  }
  
  .ai-chat-messages {
    padding: 1rem;
  }
  
  .ai-message {
    max-width: 95%;
  }
  
  .ai-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 1rem;
  }
  
  .ai-message-content {
    padding: 0.75rem;
    font-size: 0.85rem;
  }
  
  .ai-chat-form {
    padding: 0.75rem;
    gap: 0.5rem;
  }
  
  .ai-chat-form input {
    padding: 0.75rem;
  }
  
  #ai-send-btn {
    padding: 0.75rem 1rem;
  }
}

/* ================================
   FLOATING AI CHAT FAB & POPUP
   ================================ */
.ai-chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
}

.ai-fab-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b9eed 0%, #2980b9 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(59, 158, 237, 0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-fab-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(59, 158, 237, 0.5);
}

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

.ai-fab-button.active {
  background: linear-gradient(135deg, #2980b9 0%, #1a5276 100%);
}

.ai-fab-button .fab-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.ai-chat-popup {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 500px;
  max-height: calc(100vh - 150px);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chat-popup.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #3b9eed 0%, #2980b9 100%);
  color: white;
  flex-shrink: 0;
}

.ai-chat-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ai-chat-avatar {
  font-size: 1.5rem;
}

.ai-chat-title {
  font-weight: 600;
  font-size: 1rem;
}

.ai-chat-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chat-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.ai-chat-popup .ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-primary);
}

.ai-chat-popup .ai-welcome-message {
  display: block;
}

.ai-chat-popup .ai-welcome-message .ai-message-content {
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.ai-chat-popup .ai-welcome-message .ai-message-content p {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.ai-chat-popup .ai-suggestions {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
}

.ai-chat-popup .ai-suggestions li {
  background: var(--bg-elevated);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin: 0.375rem 0;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ai-chat-popup .ai-suggestions li:hover {
  background: var(--accent-muted);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.ai-chat-popup .ai-message {
  display: flex;
  max-width: 90%;
  animation: fadeIn 0.2s ease;
}

.ai-chat-popup .user-message {
  align-self: flex-end;
}

.ai-chat-popup .assistant-message {
  align-self: flex-start;
}

.ai-chat-popup .ai-message-content {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.5;
}

.ai-chat-popup .user-message .ai-message-content {
  background: var(--accent-primary);
  color: white;
  border-bottom-right-radius: var(--radius-sm);
}

.ai-chat-popup .assistant-message .ai-message-content {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-bottom-left-radius: var(--radius-sm);
}

.ai-chat-popup .ai-chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.ai-chat-popup .ai-chat-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.ai-chat-popup .ai-chat-form input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.ai-chat-popup .ai-chat-form input::placeholder {
  color: var(--text-tertiary);
}

.ai-chat-popup #ai-send-btn {
  padding: 0.75rem 1rem;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chat-popup #ai-send-btn:hover:not(:disabled) {
  background: var(--accent-secondary);
}

.ai-chat-popup #ai-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .ai-chat-fab {
    bottom: 16px;
    right: 16px;
  }

  .ai-fab-button {
    width: 54px;
    height: 54px;
  }

  .ai-fab-button .fab-icon {
    font-size: 1.5rem;
  }

  .ai-chat-popup {
    bottom: 86px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
    height: calc(100vh - 120px);
    max-height: calc(100vh - 120px);
  }
}

/* AI Upgrade Banner */
.ai-upgrade-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  height: 100%;
}

.ai-upgrade-banner .upgrade-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.ai-upgrade-banner h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.ai-upgrade-banner p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  max-width: 280px;
  line-height: 1.5;
}

.ai-upgrade-banner .upgrade-btn {
  background: linear-gradient(135deg, var(--accent-primary), #6366f1);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ai-upgrade-banner .upgrade-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ========================================
   SIMPLIFIED GROCERY SYSTEM STYLES
   ======================================== */

.section-subtitle {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* Ingredients List Simple */
.ingredients-search {
  margin-bottom: 1rem;
}

.ingredients-search input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
}

.ingredients-summary {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.ingredient-form-inline {
  background: var(--bg-tertiary);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.ingredient-form-inline .form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.ingredient-form-inline input {
  flex: 1;
  min-width: 120px;
  padding: 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

.ingredient-form-inline input#ingredient-name {
  flex: 2;
  min-width: 200px;
}

.ingredient-form-inline .form-actions {
  display: flex;
  gap: 0.75rem;
}

.ingredients-list-simple {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ingredient-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.ingredient-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ingredient-name {
  font-weight: 500;
  color: var(--text-primary);
}

.ingredient-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.ingredient-price {
  font-weight: 600;
  color: var(--success-green);
  min-width: 70px;
  text-align: right;
}

.ingredient-actions {
  display: flex;
  gap: 0.5rem;
}

.ingredient-actions button {
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.ingredient-actions .edit-btn {
  background: var(--accent-primary);
  color: white;
}

.ingredient-actions .delete-btn {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}

/* Recipes Simple */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.recipe-card-simple {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

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

.recipe-title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.recipe-actions {
  display: flex;
  gap: 0.5rem;
}

.recipe-actions button {
  padding: 0.4rem 0.6rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
}

.recipe-actions .edit-btn {
  background: var(--accent-primary);
  color: white;
}

.recipe-actions .delete-btn {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}

.recipe-ingredients-list {
  margin-bottom: 1rem;
}

.recipe-ingredients-list strong {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.recipe-ingredients-list ul {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
  color: var(--text-primary);
}

.recipe-ingredients-list li {
  padding: 0.25rem 0;
  font-size: 0.9rem;
}

.recipe-notes {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.recipe-notes strong {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.recipe-notes p {
  margin: 0.5rem 0 0;
  color: var(--text-primary);
  font-size: 0.9rem;
  white-space: pre-line;
}

.recipe-form-container {
  background: var(--bg-tertiary);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.recipe-form h4 {
  margin: 0 0 1rem;
  color: var(--text-primary);
}

.recipe-form .form-group {
  margin-bottom: 1rem;
}

.recipe-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.recipe-form input,
.recipe-form textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
}

.recipe-form textarea {
  resize: vertical;
}

/* Meal Planner */
.meal-planner-budget {
  background: var(--bg-tertiary);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.budget-info {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.budget-info span {
  color: var(--text-secondary);
}

.budget-info strong {
  color: var(--text-primary);
}

.budget-info .over-budget strong {
  color: #e74c3c;
}

.helper-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.recipe-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.recipe-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s;
}

.recipe-checkbox-item:hover {
  background: var(--bg-hover);
}

.recipe-checkbox-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-primary);
}

.recipe-checkbox-item .recipe-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

.recipe-checkbox-item .ingredient-count {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.current-shopping-list {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.current-shopping-list h4 {
  margin: 0 0 1rem;
  color: var(--text-primary);
}

.shopping-list-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.shopping-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.shopping-item .item-name {
  flex: 1;
  color: var(--text-primary);
}

.shopping-item .item-price {
  color: var(--success-green);
  font-weight: 500;
}

.shopping-item .remove-item-btn {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  border: none;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.shopping-list-total {
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  text-align: right;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.shopping-list-actions {
  display: flex;
  gap: 0.75rem;
}

/* Ingredient Popup */
.ingredient-popup,
.budget-warning-popup,
.shopping-day-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
}

.ingredient-popup .popup-content,
.budget-warning-popup .popup-content,
.shopping-day-popup .popup-content {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid var(--border-color);
}

.ingredient-popup h3,
.budget-warning-popup h3,
.shopping-day-popup h3 {
  margin: 0 0 0.5rem;
  color: var(--text-primary);
}

.popup-instructions {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.ingredient-check-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.ingredient-check-item:hover {
  background: var(--bg-hover);
}

.ingredient-check-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-primary);
}

.ingredient-check-item .ingredient-name {
  flex: 1;
  color: var(--text-primary);
}

.ingredient-check-item .ingredient-price {
  color: var(--success-green);
  font-weight: 500;
}

.ingredient-check-item .price-unknown {
  color: var(--text-secondary);
  font-style: italic;
}

.popup-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Calendar Picker */
.calendar-popup-content {
  max-width: 360px !important;
}

.calendar-picker {
  margin: 1rem 0 1.5rem;
}

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

.calendar-header #cal-month-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cal-nav-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.cal-nav-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 0;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all 0.2s;
}

.cal-day.empty {
  background: transparent;
}

.cal-day.past {
  color: var(--text-tertiary);
  opacity: 0.4;
}

.cal-day.today {
  background: var(--accent-primary);
  font-weight: 700;
}

.cal-day[data-date] {
  cursor: pointer;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
}

.cal-day[data-date]:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

.cal-day[data-date].today {
  border: 2px solid var(--accent-secondary);
}

/* Simple Shopping List */
.shopping-list-container {
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

.shopping-list-container .shopping-list-items {
  margin-bottom: 1.5rem;
}

.shopping-list-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.shopping-list-item:last-child {
  border-bottom: none;
}

.shopping-list-footer {
  margin-bottom: 1.5rem;
}

.total-row {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  font-size: 1.1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .ingredient-form-inline .form-row {
    flex-direction: column;
  }
  
  .ingredient-form-inline input {
    min-width: 100%;
  }
  
  .budget-info {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .recipes-grid {
    grid-template-columns: 1fr;
  }
  
  .day-buttons {
    grid-template-columns: 1fr;
  }
}

/* Grocery Dashboard Budget */
.grocery-dashboard-simple {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.grocery-budget-input {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.grocery-budget-input label {
  font-weight: 500;
  color: var(--text-primary);
}

.input-with-prefix {
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding-left: 0.75rem;
}

.input-with-prefix span {
  color: var(--text-secondary);
}

.input-with-prefix input {
  background: transparent;
  border: none;
  padding: 0.75rem;
  color: var(--text-primary);
  width: 100px;
  font-size: 1rem;
}

.input-with-prefix input:focus {
  outline: none;
}
