:root {
  --bg: #F2F2F2;
  --card-bg: #FFFFFF;
  --primary-light: #9694FF;
  --primary: #3D3BF3;
  --danger-light: #ff7a7a;
  --danger: #FF2929;
  --text: #000000;
  --success-light: #81c784;
  --success: #43a047;
  --text-secondary: #333446;
  --font-heading: 'Roboto Slab', serif;
  --font-body: 'Arvo', serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: linear-gradient(
    to right,
    rgba(128, 180, 208, 0.95),
    rgba(61, 107, 161, 0.95)
  );
}


a {
  color:#000000;
  text-decoration: underline;
}

/* Toggle buttons container */
.form-toggle {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Toggle buttons styling */
.toggle-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 1rem;
  cursor: pointer;
  background: var(--card-bg);
  color: var(--text-secondary);
  transition: background 0.3s, color 0.3s;
}

/* Active toggle state */
.toggle-btn.active {
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  color: #fff;
}

.login-card {
  position: absolute;
  left: 50%;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  width: 320px;
  padding: 2rem;
  z-index: 1;
}

/* Accent bar */
.login-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary-light), var(--primary));
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

.login-card h2 {
  margin: 0 0 1.5rem;
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: 1.75rem;
  color: var(--primary);
}

.tooltip-icon {
  cursor: help;
  margin-left: 0.4em;
  font-weight: bold;
  font-size: 0.9em;
  color: #666;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
  font-weight: bold;
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: var(--font-body);
  color: var(--text-secondary);
}

.forgot {
  text-align: right;
  margin-top: -1rem;
  margin-bottom: 1rem;
}

.forgot a {
  font-size: 0.85rem;
  color: var(--primary);
}

.forgot a:hover {
  text-decoration: underline;
}

.btn {
  display: block;
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  color: #fff;
  font-family: var(--font-heading);
  cursor: pointer;
  z-index: 1;
}

.btn:hover {
  opacity: 0.9;
}

.btn-delete {
  display: block;
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--danger-light), var(--danger));
  color: #fff;
  font-family: var(--font-heading);
  cursor: pointer;
  z-index: 1;
}

.btn-delete:hover {
  opacity: 0.9;
}

.btn-update {
  display: block;
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--success-light), var(--success));
  color: #fff;
  font-family: var(--font-heading);
  cursor: pointer;
  z-index: 1;
}

.btn-update:hover {
  opacity: 0.9;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

table tr:nth-child(even) {
  background-color: #f9f9f9;
}

table tr:nth-child(odd) {
  background-color: #ffffff;
}

.horizontal-buttons {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.horizontal-buttons button, .horizontal-buttons button[type="submit"] {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

/* API status text */
body > pre {
  position: relative;
  z-index: 1;
  font-family: monospace;
}

.sidebar {
  flex-direction: column;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 200px;
  background: var(--card-bg);
  padding: 1rem 0;
  border-radius: 0 16px 16px 0;
  box-shadow: 2px 0 8px rgba(0,0,0,0.1);
  z-index: 2;
}

.sidebar .logo {
  width: 100%;
  text-align: center;
  margin-bottom: 1rem;
}

body.desktop .sidebar {
  display: flex;
}

body.mobile .sidebar {
  display: none;
  position: absolute;
  z-index: 1000;
  background: var(--card-bg);
  width: 250px;
  height: 100%;
  left: 0;
  top: 0;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
}

/* Show sidebar when active */
body.mobile .sidebar.show {
  display: block;
}

.sidebar-toggle {
  display: none;
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 1100;
  padding: 0.5rem 1rem;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1.25rem;
}

body.mobile .sidebar-toggle {
  display: block;
}

.logo-img {
  width: 160px;
  height: auto;
  object-fit: contain;
  margin: 0.5rem auto;
}

.login-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: linear-gradient(
    to right,
    rgba(128, 180, 208, 0.95),
    rgba(61, 107, 161, 0.95)
  );
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4rem;
  flex-wrap: wrap;
}

.logo-image img {
  width: 650px;
  padding-right: 50%;
  height: auto;
  display: block;
}

/* Style for the account select dropdown */
#account-select {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.5rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: linear-gradient(to right, #b3aaff, #6d63ff);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  appearance: none;
  cursor: pointer;
  transition: background 0.3s ease;
}

#account-select option {
  background-color: #444;
  color: #fff;
}

#account-select:focus {
  outline: none;
  background: linear-gradient(to right, #a499ff, #5a4fff);
}

label[for="account-select"] {
  font-weight: bold;
  margin-top: 0.5rem;
  display: inline-block;
}

/* Centered vertical list with highlight */
.nav-list a {
  display: block;
  padding: 0.75rem 1rem;
  margin: 0.25rem 0;
  text-decoration: none;
  text-align: center;
  color: var(--text);
  border-radius: 8px;
  transition: background 0.3s, color 0.3s;
}
.nav-list a.active {
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  color: #fff;
}
.nav-list a:hover:not(.active) {
  background: rgba(61,59,243,0.1);
}

/* Wrapper shifted right of sidebar */
.dashboard-wrapper {
  margin: 0 auto 2rem calc(200px + 1rem);
  max-width: 1800px;
  width: calc(100% - (200px + 2rem));
  padding: 0 1rem;
}

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

/* Main grid */
.dashboard-content {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  grid-template-rows: auto auto;
  gap: 1rem;
  padding-top: 1.5rem;
}

.accountTransactions, .budgetPage, .debtPage {
  grid-template-columns: 1fr 3fr;
}

/* Card styling with accent bar */
.card {
  position: relative;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 1rem;
  align-self: flex-start;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Help icon styling */
.help-icon {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  margin-left: auto;
}

.help-icon:hover {
  background: rgba(61, 59, 243, 0.1);
  color: var(--primary-light);
  transform: scale(1.1);
}

/* Card header with help icon */
.card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.card-header-icon {
  font-size: 1.2rem;
  color: var(--primary);
}

.card-header-title {
  font-weight: bold;
  color: var(--text-primary);
  flex: 1;
}

/* Help button styling */
.btn-help {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  color: #1976d2;
  border: 1px solid #2196f3;
  transition: all 0.3s ease;
}

.btn-help:hover {
  background: linear-gradient(135deg, #bbdefb, #90caf9);
  color: #1565c0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* Collapsible sections styling */
.collapsible-section {
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.section-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 1rem 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  user-select: none;
}

.section-header:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.section-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.toggle-icon {
  transition: transform 0.3s ease;
  font-size: 1.1rem;
}

.section-content {
  display: none;
  padding: 1.5rem;
  background: white;
  border-top: 1px solid var(--border-color);
}

.section-content:first-child {
  display: block;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary-light), var(--primary));
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
  margin-left: auto;
}

.card input {
  width: 100%;
  margin: 0.25rem 0;
  padding: 0.3rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
}

/* Full-width overall balance card */
.overall-balance {
  grid-column: 1 / -1;
  padding: 1.5rem;
}

/* Responsive single-column */
@media (max-width: 1200px) {
  .dashboard-content {
    grid-template-columns: 1fr;
  }
  .dashboard-wrapper {
    margin: 0 1rem;
    width: auto;
  }
}

/* ===== NEW MODAL SYSTEM ===== */

/* Modal Backdrop */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(2px);
  }
}

/* Modal Content Container */
.modal-content {
  background-color: var(--card-bg);
  margin: 0 auto;
  padding: 2rem;
  border-radius: 16px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
  
  /* Full height sizing - adapts to user's screen */
  width: min(90%, 600px);
  height: 90vh;
  max-height: 100vh;
  
  /* Flexible layout */
  display: flex;
  flex-direction: column;
  
  /* Smooth scrolling */
  overflow-y: auto;
  overflow-x: hidden;
  
  /* Better scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #c1c1c1 #f1f1f1;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Smart Modal Sizing Based on Content Type */
.modal-content[data-modal-type="form"] {
  width: min(90%, 500px);
  height: 25vh;
  max-height: 100vh;
}

.modal-content[data-modal-type="wizard"] {
  width: min(90%, 550px);
  height: 35vh;
  max-height: 100vh;
}

.modal-content[data-modal-type="confirmation"] {
  width: min(90%, 400px);
  height: 90vh;
  max-height: 100vh;
}

.modal-content[data-modal-type="list"] {
  width: min(90%, 600px);
  height: 30vh;
  max-height: 100vh;
}

.modal-content[data-modal-type="large"] {
  width: min(95%, 900px);
  height: 90vh;
  max-height: 100vh;
}

.modal-content[data-modal-type="full"] {
  width: min(98%, 1200px);
  height: 95vh;
  max-height: 100vh;
}

.modal-content[data-modal-type="account-edit"] {
  width: min(90%, 500px);
  height: 50vh;
  max-height: 100vh;
}

/* Modal Header */
.modal-content h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--primary);
  margin: 0 0 1rem 0;
  padding-right: 2rem; /* Space for close button */
}

/* Close Button */
.close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-secondary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.close-button:hover {
  color: var(--danger);
  background-color: rgba(255, 41, 41, 0.1);
  transform: scale(1.1);
}

/* Modal Body */
.modal-body {
  flex: 1;
  overflow-y: auto;
}

/* Form Elements in Modals */
.modal-content input,
.modal-content select,
.modal-content textarea {
  width: 100%;
  padding: 0.75rem;
  margin: 0.5rem 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color 0.2s ease;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(61, 59, 243, 0.1);
}

/* Wizard Steps */
.wizard-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 0 1rem;
  gap: 0.5rem;
}

.progress-step {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: #e0e0e0;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.progress-step.active {
  background-color: var(--primary);
  color: white;
  transform: scale(1.1);
}

.progress-step.completed {
  background-color: var(--success);
  color: white;
}

.wizard-step {
  margin-bottom: 1.5rem;
}

.wizard-step p {
  margin-bottom: 0.75rem;
  font-family: var(--font-body);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Button Groups */
.horizontal-buttons {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.horizontal-buttons button {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  padding: 0.75rem 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .modal {
    padding: 10px;
  }
  
  .modal-content {
    margin: 10px auto;
    padding: 1.5rem;
    width: 95%;
    max-height: 90vh;
  }
  
  .modal-content[data-modal-type="form"] {
    width: 95%;
    max-height: 85vh;
  }
  
  .modal-content[data-modal-type="wizard"] {
    width: 95%;
    max-height: 90vh;
  }
  
  .modal-content[data-modal-type="confirmation"] {
    width: 95%;
    max-height: 80vh;
  }
  
  .modal-content[data-modal-type="large"] {
    width: 98%;
    max-height: 95vh;
  }
  
  .modal-content[data-modal-type="full"] {
    width: 98%;
    max-height: 98vh;
  }
  
  .wizard-progress {
    padding: 0 0.5rem;
  }
  
  .progress-step {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.8rem;
  }
  
  .horizontal-buttons {
    flex-direction: column;
  }
  
  .horizontal-buttons button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .modal-content {
    padding: 1rem;
    margin: 5px auto;
  }
  
  .modal-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
  }
  
  .close-button {
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    font-size: 1.25rem;
  }
}

/* Custom Scrollbar for Modal Content */
.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Modal Animation Classes */
.modal.show {
  display: block;
}

.modal.hide {
  animation: modalFadeOut 0.2s ease-in forwards;
}

@keyframes modalFadeOut {
  from {
    opacity: 1;
    backdrop-filter: blur(2px);
  }
  to {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
}

.modal-content.hide {
  animation: modalSlideOut 0.2s ease-in forwards;
}

@keyframes modalSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
}

/* Accessibility Improvements */
.modal:focus {
  outline: none;
}

.modal-content:focus {
  outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .modal-content {
    border: 2px solid var(--text);
  }
  
  .close-button {
    border: 1px solid var(--text);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .modal,
  .modal-content,
  .close-button {
    animation: none;
    transition: none;
  }
}

/* Legacy modal styles - kept for backward compatibility */
.modal-content.dynamic-compact {
  width: min(90%, 450px);
  max-height: min(70vh, 400px);
}

.modal-content.dynamic-small {
  width: min(90%, 500px);
  max-height: min(75vh, 600px);
}

.modal-content.dynamic-medium {
  width: min(90%, 700px);
  max-height: min(85vh, 800px);
}

.modal-content.dynamic-large {
  width: min(95%, 900px);
  max-height: min(90vh, 800px);
}

#debt-list, #budget-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(25%, 1fr));
  gap: 1rem;
}

#debt-modal input {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.5rem;
}

#budget-list li {
  list-style: none;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  font-family: var(--font-body);
}

#debt-list li {
  list-style: none;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  font-family: var(--font-body);
}

#suspicious-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Modern suspicious entry style */
.suspicious-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.5rem;
  border-radius: 12px;
  background: rgba(255, 41, 41, 0.03);
  margin-bottom: 0.5rem;
  border-left: 4px solid #d32f2f;
  transition: background 0.2s;
}
.suspicious-entry:hover {
  background: rgba(255,41,41,0.08);
}
.suspicious-icon {
  color: #d32f2f;
  font-size: 1.2em;
  margin-right: 0.5em;
}
.suspicious-entry .category {
  font-weight: bold;
  font-size: 0.95em;
  font-family: var(--font-heading);
  margin-right: 0.5em;
}
.suspicious-entry .description {
  flex: 1;
  font-family: var(--font-body);
  color: #222;
  font-size: 0.98em;
}
.suspicious-entry .amount {
  font-weight: bold;
  color: #d32f2f;
  white-space: nowrap;
  font-size: 1.05em;
}

/* Color-coded tags */
.category.groceries      { background-color: #d1f7c4; color: #2d662d; }
.category.transport      { background-color: #d0e8ff; color: #1d4e89; }
.category.e-commerce     { background-color: #ffe5ec; color: #ad1457; }
.category.housing        { background-color: #fff0b3; color: #8d6d1f; }
.category.uncategorized  { background-color: #ccc; color: #555; }

.suspicious-entry .description {
  flex: 1;
  font-family: 'Arvo', serif;
  color: #222;
}

.suspicious-entry .amount {
  font-weight: bold;
  color: #d32f2f;
  white-space: nowrap;
}

/* Creating button styling for additional buttons */

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
}

/* Toggle switch base */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: background-color .3s;
  border-radius: 34px;
}
/* Knob */
.slider:before {
  content: "";
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: transform .3s;
  border-radius: 50%;
}
/* Checked state */
input:checked + .slider {
  background-color: #21a3f3;
}
input:checked + .slider:before {
  transform: translateX(26px);
}

/* dark */
body[data-season="dark"] {
  background: #121212;
  color: #e0e0e0;
}

body[data-season="dark"] .card,
body[data-season="dark"] .login-card,
body[data-season="dark"] .modal-content,
body[data-season="dark"] .sidebar,
body[data-season="dark"] .sidebar a,
body[data-season="dark"] .sidebar button,
body[data-season="dark"] .sidebar .nav-list,
body[data-season="dark"] a,
body[data-season="dark"] .description {
  background-color: #1e1e1e !important;
  color: #e0e0e0;
}

body[data-season="dark"] table {
  background-color: #000;
  color: #fff;
  border-collapse: collapse;
}

body[data-season="dark"] table th,
body[data-season="dark"] table td {
  background-color: inherit;
  color: inherit;
  border-color: #333;
  padding: 0.5rem;
}

body[data-season="dark"] table tbody tr:nth-child(even) {
  background-color: #1a1a1a;
}
body[data-season="dark"] table tbody tr:nth-child(odd) {
  background-color: #000;
}

body[data-season="dark"] table a {
  color: #fff !important;
  text-decoration: underline;
}

body[data-season="dark"] table thead {
  background-color: #000;    
}

body[data-season="dark"] table thead th {
  background-color: #5000e5;    /* solid black */
  color: #fff;               
  border-color: #333;        
}

body[data-season="dark"] select,
body[data-season="dark"] select:focus {
  background-color: #2a2a2a;   /* dark field */
  color: #fff;                 /* white text */
  border: 1px solid #444;      
}

:root {
  --text-primary: var(--text);
  --border-color: #e5e7eb;
}

/* One place to define all dark colors */
body[data-season="dark"], body.dark {
  --card-bg: #16181d;        
  --text: #f2f5f9;           
  --text-secondary: #c7cdd8; 
  --border-color: #2a2f3a;   
  --link-color: #aab4ff;     
}

/* Apply */
body[data-season="dark"] .card,
body[data-season="dark"] .modal-content,
body[data-season="dark"] .sidebar,
body[data-season="dark"] .login-card {
  background-color: var(--card-bg) !important;
  color: var(--text) !important;
}

body[data-season="dark"] h1,
body[data-season="dark"] h2,
body[data-season="dark"] h3,
body[data-season="dark"] .card-header-title,
body[data-season="dark"] .budget-header h4 {
  color: var(--text) !important;
}

/* correct dimming issues */
body[data-season="dark"] .stat-label,
body[data-season="dark"] .budget-progress-info span:first-child,
body[data-season="dark"] .budget-period,
body[data-season="dark"] .description,
body[data-season="dark"] .nav-list a {
  color: var(--text-secondary) !important;
}

body[data-season="dark"] a { color: var(--link-color) !important; }

body[data-season="dark"] table th,
body[data-season="dark"] table td {
  color: var(--text) !important;
  border-color: var(--border-color) !important;
}

.help-content .tip-box,
.help-content .warning-box {
  /* keep your current backgrounds/borders; just fix the ink */
  color: #0f172a !important;                 /* slate-900: dark ink */
}

.help-content .tip-box h5,
.help-content .warning-box h5,
.help-content .tip-box p,
.help-content .warning-box p,
.help-content .tip-box li,
.help-content .warning-box li,
.help-content .tip-box strong,
.help-content .warning-box strong {
  color: #0f172a !important;
  font-weight: 500;
}

.help-content .tip-box a,
.help-content .warning-box a {
  color: #0b5cff !important;                  /* readable links on light bg */
  text-decoration: underline;
}

.help-content .overview-card {
  background: #f8fafc;                        /* light card */
  border: 1px solid rgba(148,163,184,.35);
}
.help-content .overview-card h4,
.help-content .overview-card p {
  color: #0f172a !important;
}

.help-content .section-content {
  color: #0f172a !important;             
}

.help-content .section-content p,
.help-content .section-content li,
.help-content .section-content h4,
.help-content .section-content strong,
.help-content .section-content a {
  color: #0f172a !important;
}

.help-content .section-content a {
  text-decoration: underline;
}

.help-content .section-content .tip-box,
.help-content .section-content .warning-box {
  color: #0f172a !important;
}

.help-content .section-content .tip-box h5,
.help-content .section-content .warning-box h5,
.help-content .section-content .tip-box p,
.help-content .section-content .warning-box p,
.help-content .section-content .tip-box li,
.help-content .section-content .warning-box li,
.help-content .section-content .tip-box strong,
.help-content .section-content .warning-box strong {
  color: #0f172a !important;
}

.help-content .overview-card h4,
.help-content .overview-card p {
  color: #0f172a !important;
}


/* seasonal theme progress */

/* spring */
body[data-season = "spring"] {
  background: linear-gradient(to right rgb(106, 255, 106), rgba(95, 255, 37, 0.911))
}

body[data-season = "spring"] .card,
/* body[data-season = "spring"] .login-body, */
/* #account-select:focus {
  outline: none;
  background: linear-gradient(to right, #72ff87, #70ff45);
} */
body[data-season = "spring"] .sidebar,
body[data-season = "spring"] .modal-content,
body[data-season = "spring"] .login-card,
body[data-season = "spring"] .description {
  background: linear-gradient(to right, #7dff7d, #61ff31);
  color: black;
}

/* summer */
body[data-season = "summer"] {
   background: linear-gradient (to right (yellow), (orange))
}

body[data-season = "summer"] .card,
body[data-season = "summer"] .sidebar,
body[data-season = "summer"] .modal-content,
body[data-season = "summer"] .login-card,
body[data-season = "summer"] .description {
  background: linear-gradient(to right, rgb(255, 255, 98), rgb(249, 235, 35), rgb(255, 152, 68));
  color: black;
}

/* fall */

body[data-season = "fall"] {
   background: linear-gradient (to right (rgb(255, 142, 72)), (rgb(214, 249, 59)), rgb(52, 0, 0))
}

body[data-season = "fall"] .card,
body[data-season = "fall"] .sidebar,
body[data-season = "fall"] .modal-content,
body[data-season = "fall"] .login-card,
body[data-season = "fall"] .description {
  background: linear-gradient(to right, rgb(255, 142, 72), rgb(236, 154, 13), rgb(52, 0, 0));
  color: black;
}

/* winter */

body[data-season = "winter"] {
   background: linear-gradient (to right (rgb(255, 142, 72)), (rgb(214, 249, 59)), rgb(52, 0, 0))
}

body[data-season = "winter"] .card,
body[data-season = "winter"] .sidebar,
body[data-season = "winter"] .modal-content,
body[data-season = "winter"] .login-card,
body[data-season = "winter"] .description {
  background: linear-gradient(to right, rgb(190, 230, 255), rgb(7, 218, 255), rgb(0, 107, 153));
  color: black;
}

/* holiday fluctuate adding functionality later C feature */

body[data-season = "holiday"] {
   background: linear-gradient (to right, rgb(255, 48, 48), rgb(255, 255, 255), rgb(7, 74, 232))
}

body[data-season = "holiday"] .card,
body[data-season = "holiday"] .sidebar,
body[data-season = "holiday"] .modal-content,
body[data-season = "holiday"] .login-card,
body[data-season = "holiday"] .description {
  background: linear-gradient(to right, rgb(255, 48, 48), rgb(255, 255, 255), rgb(7, 74, 232));
  color: black;
}

body[data-season = "Return Settings To Default"] .card,
body[data-season = "Return Settings To Default"] .sidebar,
body[data-season = "Return Settings To Default"] .modal-content,
body[data-season = "Return Settings To Default"] .login-card,
body[data-season = "Return Settings To Default"] .description {
  background-color: white;
  color: black;
}
  
:root{
  --user-font-size: 16px;
}
body{
  font-size: var(--user-font-size);
}

#notification-bell {
  position: fixed;
  top: 25px;
  right: 40px;
  width: 30px; 
  height: auto;
  cursor: pointer;
  z-index: 1000; 
  transition: transform 0.2s ease;
}

#notification-bell:hover {
  transform: scale(1.1);
}

/* default */
#notification-bell {
  filter: none;
}

/* in dark mode swap to white */
body[data-season="dark"] #notification-bell {
  filter: invert(1) brightness(1.2);
}

.twofa-inline {
  display: flex;
  align-items: center;
  margin-top: 10px;
}

.twofa-inline label {
  display: flex;
  align-items: center;
  gap: 8px; /* space between checkbox and label text */
  font-weight: bold;
  font-size: 0.95rem;
  color: white;
}

.twofa-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
}
/* corrected issue pertaining to slider position under txt, now adjacent */
.font-slider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.font-slider-row label {
  white-space: nowrap;
  margin-right: 10px;
}

.font-slider-row input[type="range"] {
  flex-grow: 1;
  max-width: 300px;
}

/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
section.card {
  margin-bottom: 10px;
}

section.card h2,
section.card h3 {
  margin-top: 0;
}

.amount-negative {
  color: #d32f2f !important;
}
.amount-positive {
  color: #388e3c !important;
}

/* Dark mode for amount colors */
body.dark .amount-negative {
  color: #ff7a7a !important;
}
body.dark .amount-positive {
  color: #81c784 !important;
}

/* Sidebar nav with icons */
.nav-list a, .nav-list button {
  display: flex;
  align-items: center;
  gap: 0.6em;
  justify-content: center;
}

.nav-list i {
  font-size: 1.1em;
  width: 1.2em;
  text-align: center;
}

/* Modern list item styles for dashboard lists */
.account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.5rem;
  border-radius: 12px;
  background: rgba(61,59,243,0.03);
  margin-bottom: 0.5rem;
  transition: background 0.2s;
}
.account-item:hover {
  background: rgba(61,59,243,0.08);
}
.account-icon {
  color: var(--primary);
  font-size: 1.2em;
  margin-right: 0.5em;
}
.account-name {
  font-weight: bold;
  font-family: var(--font-heading);
}
.account-balance {
  font-size: 1.1em;
  font-weight: 500;
}
.account-balance.positive { color: #388e3c; }
.account-balance.negative { color: #d32f2f; }

.debt-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.5rem;
  border-radius: 12px;
  background: rgba(255,41,41,0.03);
  margin-bottom: 0.5rem;
  border-left: 4px solid #d32f2f;
  transition: background 0.2s;
}
.debt-item:hover {
  background: rgba(255,41,41,0.08);
}
.debt-icon {
  color: #d32f2f;
  font-size: 1.2em;
  margin-right: 0.5em;
}
.debt-name {
  font-weight: bold;
  font-family: var(--font-heading);
}
.debt-amount {
  font-size: 1.1em;
  font-weight: 500;
  color: #d32f2f;
}

.budget-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.5rem;
  border-radius: 12px;
  background: rgba(61,59,243,0.03);
  margin-bottom: 0.5rem;
  transition: background 0.2s;
}
.budget-item:hover {
  background: rgba(61,59,243,0.08);
}
.budget-icon {
  color: var(--primary);
  font-size: 1.2em;
  margin-right: 0.5em;
}
.budget-name {
  font-weight: bold;
  font-family: var(--font-heading);
}
.budget-amounts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}
.budget-progress-bar {
  width: 100px;
  height: 8px;
  background: #e0e0e0;
  border-radius: 6px;
  margin-top: 0.3em;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.budget-progress-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease, background-color 0.3s ease;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.budget-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

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

.budget-progress-fill.success { 
  background: linear-gradient(90deg, #388e3c, #4caf50); 
}
.budget-progress-fill.warning { 
  background: linear-gradient(90deg, #ff9800, #ffb74d); 
}
.budget-progress-fill.danger { 
  background: linear-gradient(90deg, #d32f2f, #f44336); 
}

/* Budget Progress Visualization Styles */
.budget-card {
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.budget-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

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

.budget-header h4 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.budget-status {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.budget-progress-section {
  margin: 1rem 0;
}

.budget-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.budget-progress-info span:first-child {
  color: var(--text-secondary);
}

.budget-progress-info span:last-child {
  font-weight: 600;
  color: var(--primary);
}

.budget-progress-bar {
  width: 100%;
  height: 8px;
  background-color: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.budget-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease, background-color 0.3s ease;
  position: relative;
}

.budget-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

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

.budget-details {
  margin: 1rem 0;
}

.budget-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

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

.budget-row span:first-child {
  color: var(--text-secondary);
  font-weight: 500;
}

.budget-amount {
  font-weight: 600;
  color: var(--text);
}

.budget-period {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.budget-time-left {
  font-weight: 500;
  font-size: 0.85rem;
}

.budget-time-left:not(:empty) {
  color: var(--primary);
}

/* Status-specific styles */
.budget-progress-fill.completed {
  background: linear-gradient(90deg, #388e3c, #4caf50) !important;
}

.budget-progress-fill.near-complete {
  background: linear-gradient(90deg, #ff9800, #ffb74d) !important;
}

.budget-progress-fill.on-track {
  background: linear-gradient(90deg, #1976d2, #42a5f5) !important;
}

.budget-progress-fill.behind {
  background: linear-gradient(90deg, #ff9800, #ffcc02) !important;
}

.budget-progress-fill.at-risk {
  background: linear-gradient(90deg, #d32f2f, #f44336) !important;
}

/* Dark mode support */
body.dark .budget-card {
  background: #1e1e1e;
  border: 1px solid #333;
}

body.dark .budget-row {
  border-bottom-color: #333;
}

body.dark .budget-progress-bar {
  background-color: #333;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}



body.dark .budget-progress-fill.success { 
  background: linear-gradient(90deg, #4caf50, #66bb6a); 
}
body.dark .budget-progress-fill.warning { 
  background: linear-gradient(90deg, #ffb74d, #ffcc02); 
}
body.dark .budget-progress-fill.danger { 
  background: linear-gradient(90deg, #f44336, #ef5350); 
}

body.dark .budget-header h4 {
  color: #e0e0e0;
}

body.dark .budget-amount {
  color: #e0e0e0;
}

body.dark .budget-period {
  color: #aaa;
}

body.dark .budget-time-left {
  color: #64b5f6;
}

/* Budget Summary Stats */
.budget-summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(61,59,243,0.05), rgba(150,148,255,0.05));
  border-radius: 12px;
  border: 1px solid rgba(61,59,243,0.1);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-heading);
  margin-bottom: 0.5rem;
}

.overall-progress-bar {
  width: 100%;
  height: 6px;
  background-color: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.overall-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: 3px;
  transition: width 0.6s ease;
  width: 0%;
}

/* Dark mode for budget summary stats */
body.dark .budget-summary-stats {
  background: linear-gradient(135deg, rgba(61,59,243,0.1), rgba(150,148,255,0.1));
  border: 1px solid rgba(61,59,243,0.2);
}

body.dark .stat-label {
  color: #aaa;
}

body.dark .stat-value {
  color: #aab4ff;
}

body.dark .overall-progress-bar {
  background-color: #333;
}

body.dark .overall-progress-fill {
  background: linear-gradient(90deg, #64b5f6, #1976d2);
}

/* Budget Search and Filter Styles */
.budget-controls-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(61,59,243,0.02);
  border-radius: 12px;
  border: 1px solid rgba(61,59,243,0.1);
}

.search-filter-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 250px;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  background: white;
  transition: border-color 0.3s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(61,59,243,0.1);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 0.9rem;
}

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

.filter-controls select {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-toggle {
  padding: 0.75rem 1rem;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: white;
  color: var(--primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

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

/* Debt progress colors */
.debt-progress-fill.completed {
  background: linear-gradient(90deg, #388e3c, #4caf50) !important;
}

.debt-progress-fill.near-complete {
  background: linear-gradient(90deg, #ff9800, #ffb74d) !important;
}

.debt-progress-fill.on-track {
  background: linear-gradient(90deg, #1976d2, #42a5f5) !important;
}

.debt-progress-fill.behind {
  background: linear-gradient(90deg, #ff9800, #ffcc02) !important;
}

.debt-progress-fill.at-risk {
  background: linear-gradient(90deg, #d32f2f, #f44336) !important;
}

/* Debt status badges */
.debt-status {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Amortization button styling */
.btn-amortization {
  background: linear-gradient(90deg, #6c757d, #495057) !important;
  color: white !important;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.3s;
}

.btn-amortization:hover {
  opacity: 0.9;
}

/* Dark mode for debt cards */
body.dark .debt-card {
  background: #1e1e1e;
  border: 1px solid #333;
}



body.dark .btn-amortization {
  background: linear-gradient(90deg, #495057, #343a40) !important;
}

/* Debt-specific grid layout */
#debt-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

/* Debt card hover effects */
.debt-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Debt progress bar specific styling */
.debt-card .budget-progress-fill {
  background: linear-gradient(90deg, #d32f2f, #f44336);
}

.debt-card .budget-progress-fill.completed {
  background: linear-gradient(90deg, #388e3c, #4caf50) !important;
}

.debt-card .budget-progress-fill.near-complete {
  background: linear-gradient(90deg, #ff9800, #ffb74d) !important;
}

.debt-card .budget-progress-fill.on-track {
  background: linear-gradient(90deg, #1976d2, #42a5f5) !important;
}

.debt-card .budget-progress-fill.behind {
  background: linear-gradient(90deg, #ff9800, #ffcc02) !important;
}

.debt-card .budget-progress-fill.at-risk {
  background: linear-gradient(90deg, #d32f2f, #f44336) !important;
}

/* Budget Notes Styles */
.budget-notes {
  margin: 0.5rem 0;
  padding: 0.5rem;
  background: rgba(61,59,243,0.05);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-left: 3px solid var(--primary-light);
}

.budget-notes:empty {
  display: none;
}

/* Priority Badge Styles */
.priority-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 0.5rem;
}

.priority-badge.high { background: #ffebee; color: #c62828; }
.priority-badge.medium-high { background: #fff3e0; color: #ef6c00; }
.priority-badge.medium { background: #e3f2fd; color: #1565c0; }
.priority-badge.medium-low { background: #f3e5f5; color: #7b1fa2; }
.priority-badge.low { background: #e8f5e8; color: #2e7d32; }
.priority-badge.generic {
  background: #e0e0e0;
  color: #333;
  font-weight: 600;
}

/* Archive Styles */
.budget-card.archived,
.debt-card.archived {
  opacity: 0.7;
  background: #f5f5f5;
}

.budget-card.archived .budget-header h4,
.debt-card.archived .budget-header h4 {
  text-decoration: line-through;
}

.archived-budgets-section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 2px solid #eee;
}

.archived-budgets-section h3 {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

/* Wizard Step Styles */
.wizard-step textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: var(--font-body);
  resize: vertical;
  min-height: 80px;
}

.wizard-step select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: var(--font-body);
  background: white;
}

/* Dark mode support */
body.dark .budget-controls-section {
  background: rgba(61,59,243,0.1);
  border: 1px solid rgba(61,59,243,0.2);
}

body.dark .search-box input,
body.dark .filter-controls select {
  background: #1e1e1e;
  border-color: #333;
  color: #e0e0e0;
}

body.dark .btn-toggle {
  background: #1e1e1e;
  border-color: #64b5f6;
  color: #64b5f6;
}

body.dark .btn-toggle:hover,
body.dark .btn-toggle.active {
  background: #64b5f6;
  color: #1e1e1e;
}

body.dark .budget-notes {
  background: rgba(61,59,243,0.15);
  color: #aaa;
}

body.dark .budget-card.archived,
body.dark .debt-card.archived {
  background: #2a2a2a;
}

body.dark .archived-budgets-section {
  border-top-color: #333;
}

body.dark .wizard-step textarea,
body.dark .wizard-step select {
  background: #1e1e1e;
  border-color: #333;
  color: #e0e0e0;
}

/* Modern scrollable transactions table */
.transactions-scroll {
  max-height: 60vh;
  min-height: 260px;
  overflow-y: auto;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(61,59,243,0.06);
  background: #fff;
}
.transactions-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 600px;
  background: transparent;
}
.transactions-table thead th {
  position: sticky;
  top: 0;
  background: #f5f6fa;
  z-index: 2;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary);
  border-bottom: 2px solid #e0e0e0;
  padding: 0.85rem 0.5rem;
}
.transactions-table tbody td {
  padding: 0.75rem 0.5rem;
  font-size: 0.98rem;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.transactions-table tbody tr:hover td {
  background: rgba(61,59,243,0.04);
}
.transactions-table .amount-negative {
  color: #d32f2f;
  font-weight: 600;
}
.transactions-table .amount-positive {
  color: #388e3c;
  font-weight: 600;
}
.category-badge {
  display: inline-block;
  background: rgba(61,59,243,0.10);
  color: var(--primary);
  font-size: 0.88em;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.18em 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
@media (max-width: 900px) {
  .transactions-scroll {
    max-height: 260px;
  }
  .transactions-table {
    min-width: 400px;
  }
}

body.dark .transactions-scroll {
  background: #23232b;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
body.dark .transactions-table thead th {
  background: #23232b;
  color: #aab4ff;
  border-bottom: 2px solid #33344a;
}
body.dark .transactions-table tbody td {
  background: #181820;
  color: #e0e0e0;
  border-bottom: 1px solid #23232b;
}
body.dark .transactions-table tbody tr:hover td {
  background: #23232b;
}
body.dark .category-badge {
  background: #2d2d4d;
  color: #aab4ff;
}
body.dark .transactions-table .amount-negative {
  color: #ff7a7a;
}
body.dark .transactions-table .amount-positive {
  color: #81c784;
}

/* Modern card h4 heading style */
.card h4 {
  font-family: var(--font-heading);
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.02em;
  margin: 0 0 0.7em 0;
  padding-left: 0.1em;
  border-left: 4px solid var(--primary-light);
  padding-left: 0.7em;
  background: none;
  text-transform: capitalize;
  display: flex;
  align-items: center;
  gap: 0.5em;
}
body.dark .card h4 {
  color: #aab4ff;
  border-left: 4px solid var(--primary);
}

/* Modern Total Debt and Total Budget link styles */
.total-debt-link,
.total-budget-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  padding: 0.5em 0 0.2em 0;
  font-size: 1.08em;
  font-weight: 500;
  margin-top: 0.5em;
  border-radius: 6px;
  transition: background 0.15s;
}
.total-debt-link:hover,
.total-budget-link:hover {
  background: rgba(61,59,243,0.06);
}
.total-label {
  font-weight: bold;
  color: var(--text);
  text-decoration: none;
}
.total-amount {
  font-weight: bold;
  font-family: var(--font-heading);
  text-decoration: none;
}
.debt-amount {
  color: #d32f2f;
}
.budget-amount {
  color: var(--primary);
}
body.dark .total-label {
  color: #e0e0e0;
}
body.dark .total-debt-link:hover,
body.dark .total-budget-link:hover {
  background: #23232b;
}

/* Modern overall balance card header styles */
.card.overall-balance {
  padding: 2.2rem 2rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--card-bg);
}
.card-header {
  display: flex;
  align-items: center;
  gap: 0.7em;
  margin-bottom: 0.2em;
}
.card-header-icon {
  color: var(--primary);
  font-size: 1.5em;
}
.card-header-title {
  font-family: var(--font-heading);
  font-size: 1.35em;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.01em;
}
.card-header-accent {
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: 2px;
  margin-bottom: 1.2em;
}
.overall-balance-amount {
  font-size: 3.2em;
  font-weight: 600;
  color: #388e3c;
  font-family: var(--font-heading);
  margin-bottom: 0.2em;
}
.overall-balance-subtitle {
  font-size: 1.05em;
  color: var(--text-secondary);
  margin-top: 0.2em;
}
body.dark .card-header-title {
  color: #aab4ff;
}
body.dark .card-header-accent {
  background: linear-gradient(90deg, var(--primary), #4444aa);
}

/* Update form: Notes and Priority side by side */
.budget-update-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.budget-update-row label {
  font-weight: 600;
  margin-bottom: 0.3rem;
  display: block;
}
.budget-update-notes {
  flex: 2;
  min-width: 160px;
}
.budget-update-priority {
  flex: 1;
  min-width: 120px;
}
.budget-update-notes textarea {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: #fafaff;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.2s;
}
.budget-update-notes textarea:focus {
  border-color: var(--primary);
  outline: none;
}
.budget-update-priority select {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: #fafaff;
  transition: border-color 0.2s;
}
.budget-update-priority select:focus {
  border-color: var(--primary);
  outline: none;
}
@media (max-width: 700px) {
  .budget-update-row {
    flex-direction: column;
    gap: 0.5rem;
  }
}

body.dark .budget-update-notes textarea,
body.dark .budget-update-priority select {
  background: #23232b;
  color: #e0e0e0;
  border-color: #333;
}
body.dark .budget-update-notes textarea:focus,
body.dark .budget-update-priority select:focus {
  border-color: #64b5f6;
}
.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 360px;
  max-height: 500px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-family: "Roboto Slab", serif;
}

.chat-header {
  background: linear-gradient(to right, #4b6cb7, #182848);
  color: white;
  padding: 14px;
  text-align: center;
  font-weight: bold;
}

.chat-body {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  background: #f9f9f9;
}
.chat-body, .chat-body * {
  white-space: pre-wrap;   
  word-break: break-word;  
}

.chat-footer {
  display: flex;
  padding: 10px;
  background: #eee;
}

#chat-input {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1em;
}

#chat-send {
  background: linear-gradient(to right, #6a11cb, #2575fc);
  color: white;
  padding: 10px 14px;
  margin-left: 8px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

/* Debt Payoff Strategy Calculator Styles */
.debt-action-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.strategy-inputs {
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.strategy-input-group {
  margin-bottom: 1rem;
}

.strategy-input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
  color: var(--text-secondary);
}

.strategy-input-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.strategy-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.strategy-card {
  padding: 1.5rem;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  background: white;
}

.strategy-card.snowball {
  border-color: #2196f3;
}

.strategy-card.avalanche {
  border-color: #ff9800;
}

.strategy-card h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.strategy-card h4 i {
  font-size: 1.2em;
}

.strategy-description {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.strategy-stats {
  margin-bottom: 1rem;
}

.strategy-stats .stat {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.strategy-stats .stat:last-child {
  border-bottom: none;
}

.stat-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.stat-value {
  font-weight: bold;
  color: var(--primary);
}

.debt-order {
  margin-top: 1rem;
}

.debt-order h5 {
  margin: 0 0 0.5rem 0;
  color: var(--text-secondary);
}

.debt-order ol {
  margin: 0;
  padding-left: 1.5rem;
}

.debt-order li {
  margin-bottom: 0.25rem;
  color: #666;
}

.strategy-recommendation {
  padding: 1.5rem;
  background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.strategy-recommendation h4 {
  margin: 0 0 1rem 0;
  color: var(--text-secondary);
}

.recommendation h5 {
  margin: 0 0 0.5rem 0;
  color: var(--primary);
  font-size: 1.1rem;
}

.recommendation p {
  margin: 0;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Dark mode support for strategy calculator */
body.dark .strategy-inputs {
  background: #2d3748;
}

body.dark .strategy-card {
  background: #1a202c;
  border-color: #4a5568;
}

body.dark .strategy-stats .stat {
  border-bottom-color: #4a5568;
}

body.dark .strategy-recommendation {
  background: linear-gradient(135deg, #2d3748, #4a5568);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .strategy-comparison {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .debt-action-buttons {
    flex-direction: column;
  }
  
  .debt-action-buttons .btn {
    width: 100%;
  }
}

/* Budget Templates Styles */
.budget-action-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.templates-container {
  max-height: 90vh;
  overflow-y: auto;
}

.template-category {
  margin-bottom: 2rem;
}

.template-category h4 {
  margin: 0 0 1rem 0;
  color: var(--text-secondary);
  font-size: 1.2rem;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 0.5rem;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.template-card {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.template-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

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

.template-header h5 {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.template-badge {
  background: var(--primary-light);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
}

.template-card p {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.template-preview {
  margin-bottom: 1rem;
}

.template-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

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

.template-item span:first-child {
  color: var(--text-secondary);
}

.template-item span:last-child {
  font-weight: bold;
  color: var(--primary);
}

.template-card .use-template {
  width: 100%;
  margin-top: 0.5rem;
}

/* Dark mode support for budget templates */
body.dark .template-card {
  background: #1a202c;
  border-color: #4a5568;
}

body.dark .template-card:hover {
  border-color: #64b5f6;
}

body.dark .template-item {
  border-bottom-color: #4a5568;
}

/* Mobile responsiveness for templates */
@media (max-width: 768px) {
  .template-grid {
    grid-template-columns: 1fr;
  }
  
  .budget-action-buttons {
    flex-direction: column;
  }
  
  .budget-action-buttons .btn {
    width: 100%;
  }
}

/* Payment Timing Optimizer Styles */
.timing-inputs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.timing-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.timing-input-group input,
.timing-input-group select {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  background: var(--card-bg);
  color: var(--text);
}

.timing-input-group input:focus,
.timing-input-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(61, 59, 243, 0.1);
}

.timing-summary {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  max-height: 300px;
  overflow-y: auto;
}

.timing-summary h4 {
  margin: 0 0 1rem 0;
  color: var(--primary);
  font-family: var(--font-heading);
  position: sticky;
  top: 0;
  background: #f8f9fa;
  padding: 0.5rem 0;
  z-index: 1;
}

.timing-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.timing-stats .stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timing-recommendations {
  margin-bottom: 2rem;
  max-height: 400px;
  overflow-y: auto;
}

.timing-recommendations h4 {
  margin: 0 0 1rem 0;
  color: var(--primary);
  font-family: var(--font-heading);
  position: sticky;
  top: 0;
  background: var(--card-bg);
  padding: 0.5rem 0;
  z-index: 1;
}

.recommendation-item {
  background: var(--card-bg);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border-left: 4px solid var(--primary);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.recommendation-item.high {
  border-left-color: #f44336;
}

.recommendation-item.medium {
  border-left-color: #ff9800;
}

.recommendation-item.strategy {
  border-left-color: #4caf50;
}

.recommendation-item h5 {
  margin: 0 0 0.5rem 0;
  color: var(--text-secondary);
  font-family: var(--font-heading);
}

.recommendation-item p {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.timing-chart {
  margin-bottom: 2rem;
  max-height: 400px;
  overflow-y: auto;
}

.timing-chart h4 {
  margin: 0 0 1rem 0;
  color: var(--primary);
  font-family: var(--font-heading);
  position: sticky;
  top: 0;
  background: var(--card-bg);
  padding: 0.5rem 0;
  z-index: 1;
}

.timing-insights {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.timing-insights h4 {
  margin: 0 0 1rem 0;
  color: var(--primary);
  font-family: var(--font-heading);
  position: sticky;
  top: 0;
  background: #f8f9fa;
  padding: 0.5rem 0;
  z-index: 1;
}

/* Advanced Analytics Styles */
.analytics-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid #eee;
  padding-bottom: 1rem;
  flex-wrap: wrap;
}

.tab-button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.tab-button:hover {
  background: rgba(61, 59, 243, 0.1);
  color: var(--primary);
}

.tab-button.active {
  background: var(--primary);
  color: white;
}

.tab-content {
  position: relative;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.analytics-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border: 1px solid #eee;
  max-height: 400px;
  overflow-y: auto;
}

.analytics-card.full-width {
  grid-column: 1 / -1;
  max-height: 1000px;
}

.analytics-card h4 {
  margin: 0 0 1rem 0;
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  top: 0;
  background: var(--card-bg);
  padding: 0.5rem 0;
  z-index: 1;
}

.summary-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
}

.summary-stat:last-child {
  border-bottom: none;
}

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

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

.efficiency-score,
.savings-rate-display,
.achievement-score {
  text-align: center;
  margin-bottom: 1rem;
}

.score-circle,
.rate-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary);
  position: relative;
}

.score-circle::before,
.rate-circle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: var(--card-bg);
  border-radius: 50%;
  z-index: 1;
}

.score-circle span,
.rate-circle span {
  position: relative;
  z-index: 2;
}

.efficiency-details,
.savings-details {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
}

.efficiency-details p,
.savings-details p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.risk-score,
.achievement-score {
  text-align: center;
  margin-bottom: 1rem;
}

.risk-indicator,
.achievement-indicator {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  color: white;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.risk-factors,
.achievement-breakdown {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
}

.risk-factors p,
.achievement-breakdown p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.projection-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.projection-controls label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.projection-controls input {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 100px;
}

.timeline-item,
.savings-item {
  background: var(--card-bg);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-item:last-child,
.savings-item:last-child {
  margin-bottom: 0;
}

.timeline-item h5,
.savings-item h5 {
  margin: 0 0 0.5rem 0;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.9rem;
}

.timeline-item p,
.savings-item p {
  margin: 0;
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
}

.savings-item.highlight {
  border-left: 4px solid var(--primary);
  background: rgba(61, 59, 243, 0.05);
}

.report-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.report-options .btn {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  text-align: center;
}

#report-status {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  text-align: center;
}

#report-status p {
  margin: 0;
  color: var(--text-secondary);
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--card-bg);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.history-item:last-child {
  margin-bottom: 0;
}

.history-item span:first-child {
  font-weight: 600;
  color: var(--text-secondary);
}

.history-item span:last-child {
  font-size: 0.9rem;
  color: #666;
}

/* Dark Mode Support */
body.dark .timing-input-group input,
body.dark .timing-input-group select {
  background: #2d2d2d;
  border-color: #444;
  color: #fff;
}

body.dark .timing-summary,
body.dark .timing-insights {
  background: #2d2d2d;
}

body.dark .recommendation-item,
body.dark .insight-item,
body.dark .analytics-card,
body.dark .timeline-item,
body.dark .savings-item,
body.dark .history-item {
  background: #2d2d2d;
  border-color: #444;
}

body.dark .efficiency-details,
body.dark .savings-details,
body.dark .risk-factors,
body.dark .achievement-breakdown,
body.dark #report-status {
  background: #1a1a1a;
}

body.dark .score-circle::before,
body.dark .rate-circle::before {
  background: #2d2d2d;
}

body.dark .tab-button {
  color: #ccc;
}

body.dark .tab-button:hover {
  background: rgba(61, 59, 243, 0.2);
}

body.dark .tab-button.active {
  background: var(--primary);
  color: white;
}

body.dark .analytics-tabs {
  border-bottom-color: #444;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .modal {
    padding: 10px;
  }
  
  /* Dynamic sizing adjustments for mobile */
  .modal-content.dynamic-compact {
    width: 95%;
    max-width: 350px;
    max-height: min(300px, calc(100vh - 20px));
    margin: 10px auto;
    padding: 1.5rem;
  }
  
  .modal-content.dynamic-small {
    width: 95%;
    max-width: 400px;
    max-height: min(500px, calc(100vh - 20px));
    margin: 10px auto;
    padding: 1.5rem;
  }
  
  .modal-content.dynamic-medium {
    width: 98%;
    max-width: 600px;
    max-height: min(700px, calc(100vh - 20px));
    margin: 5px auto;
    padding: 1rem;
  }
  
  .modal-content.dynamic-large {
    width: 98%;
    max-height: calc(100vh - 20px);
    margin: 5px auto;
    padding: 1rem;
  }
  
  /* Large modals (analytics, timing optimizer, etc.) */
  .modal-content[style*="max-width: 800px"],
  .modal-content[style*="max-width: 900px"],
  .modal-content[style*="max-width: 1000px"] {
    width: 98%;
    margin: 5px auto;
    padding: 1rem;
    max-height: calc(100vh - 20px);
  }
  
  .timing-stats {
    grid-template-columns: 1fr;
  }
  
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  
  .analytics-tabs {
    flex-wrap: wrap;
  }
  
  .tab-button {
    flex: 1;
    min-width: 120px;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }
  
  .projection-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .projection-controls label {
    justify-content: space-between;
  }
  
  .projection-controls input {
    width: 100%;
  }
  
  .report-options {
    grid-template-columns: 1fr;
  }
  
  .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .analytics-card {
    max-height: 300px;
  }
  
  .analytics-card.full-width {
    max-height: 400px;
  }
  
  .timing-summary,
  .timing-recommendations,
  .timing-chart,
  .timing-insights {
    max-height: 300px;
  }
}

.insight-item {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.category-view-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.toggle-buttons {
  display: flex;
  background: var(--background-secondary, #f8f9fa);
  border-radius: 12px;
  padding: 0.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary, #666);
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.toggle-btn:hover {
  color: var(--text-primary, #333);
  background: rgba(255, 255, 255, 0.5);
}

.toggle-btn.active {
  background: var(--primary, #007bff);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.toggle-btn i {
  font-size: 0.9rem;
}

/* Enhanced Category Items for Plaid */
.category-item.plaid-enhanced {
  padding: 1.5rem;
  border-left: 4px solid transparent;
  transition: all 0.3s ease;
}

.category-item.plaid-enhanced:hover {
  border-left-color: var(--primary, #007bff);
  background: linear-gradient(135deg, var(--background-hover, #f8f9fa) 0%, #fff 100%);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.category-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-right: 0.5rem;
}

.category-info {
  align-items: flex-start;
}

.category-details {
  flex: 1;
}

.subcategories {
  font-size: 0.8rem;
  color: var(--text-secondary, #666);
  font-style: italic;
  margin-top: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: var(--background-secondary, #f8f9fa);
  border-radius: 6px;
  border-left: 3px solid var(--primary, #007bff);
}

/* Enhanced Chart Container */
.chart-container {
  position: relative;
  overflow: hidden;
}

.chart-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, 
    #FF6B6B 0%, #4ECDC4 25%, #45B7D1 50%, #F7DC6F 75%, #BB8FCE 100%);
  border-radius: 16px 16px 0 0;
}

/* Insights Container Enhancement */
.insights-container {
  position: relative;
  overflow: hidden;
}

.insights-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0.05) 50%, 
    rgba(255, 255, 255, 0.1) 100%);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Category Breakdown Enhancements */
.category-breakdown {
  position: relative;
}

.category-breakdown h4 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.category-breakdown h4::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
  animation: slideRight 2s ease-in-out infinite;
}

@keyframes slideRight {
  0% { transform: translateX(-100px); }
  100% { transform: translateX(400px); }
}

/* Percentage Badge Enhancement */
.amount-percentage {
  position: relative;
  overflow: hidden;
}

.amount-percentage::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  transition: left 0.5s ease;
}

.category-item:hover .amount-percentage::before {
  left: 100%;
}

/* Loading State for Plaid */
.plaid-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 2rem;
  text-align: center;
}

.plaid-loading::before {
  content: '';
  width: 60px;
  height: 60px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary, #007bff);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Category Color Indicator */
.category-color {
  position: relative;
}

.category-color::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.3;
  transform: scale(0);
  transition: transform 0.3s ease;
}

.category-item:hover .category-color::after {
  transform: scale(1.2);
}

/* Summary Stats Enhancement */
.stat-item {
  position: relative;
  overflow: hidden;
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary, #007bff), #6f42c1);
  transition: left 0.3s ease;
}

.stat-item:hover::before {
  left: 0;
}

#bg-chat-launcher{
  position: fixed; right: 20px; bottom: 20px; z-index: 3000;
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,.25); font-size: 22px; background: #2e2eec; color: #fff;
}

/* Slide-out */
#bg-chat-panel{
  position: fixed; right: -360px; bottom: 20px; width: 340px; height: 520px; z-index: 3001;
  background: #fff; border-radius: 16px; box-shadow: 0 12px 28px rgba(0,0,0,.25);
  display: flex; flex-direction: column; transition: right .25s ease;
}
#bg-chat-panel.open{ right: 20px; }
#bg-chat-panel header{
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #2e2eec; color: #fff; border-top-left-radius: 16px; border-top-right-radius:16px;
}
#bg-chat-close{ border:none; background:transparent; color:#fff; font-size:20px; cursor:pointer; }

#bg-chat-log{ flex:1; padding: 12px; overflow-y:auto; font-size: 14px; }
#bg-chat-log .ai{ background:#f3f4ff; border:1px solid #e3e5ff; padding:10px; border-radius:10px; margin:8px 0; }
#bg-chat-log .me{ background:#eefaf2; border:1px solid #daf2df; padding:10px; border-radius:10px; margin:8px 0; text-align:right; }
#bg-chat-log .suggest{ display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; }
.suggest-btn{ border:1px solid #e3e5ff; background:#fff; padding:6px 8px; border-radius:8px; cursor:pointer; }

/* Responsive Design for Plaid Categories */
@media (max-width: 992px) {
  .toggle-buttons {
    flex-direction: column;
    width: 200px;
  }
  
  .toggle-btn {
    justify-content: center;
    padding: 0.75rem 1rem;
  }
  
  .category-icon {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .category-view-toggle {
    margin-bottom: 1rem;
  }
  
  .toggle-buttons {
    width: 100%;
    max-width: 300px;
  }
  
  .insights-container {
    padding: 1rem;
  }
  
  .insight-item {
    padding: 0.75rem;
  }
  
  .category-item.plaid-enhanced {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .category-info {
    width: 100%;
  }
  
  .category-amount {
    align-self: stretch;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .subcategories {
    margin-top: 0.5rem;
  }
}

@media (max-width: 480px) {
  .category-icon {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }
  
  .insight-item span {
    font-size: 0.85rem;
  }
  
  .toggle-btn {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
  }
}

/* Dark Mode Support (if applicable) */
@media (prefers-color-scheme: dark) {
  .category-icon {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .subcategories {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
  }
  
  .toggle-buttons {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* Accessibility Enhancements */
.toggle-btn:focus {
  outline: 2px solid var(--primary, #007bff);
  outline-offset: 2px;
}

.category-item:focus-within {
  outline: 2px solid var(--primary, #007bff);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Print Styles */
@media print {
  .toggle-buttons,
  .chart-container,
  .insights-container {
    break-inside: avoid;
  }
  
  .category-item {
    break-inside: avoid;
    margin-bottom: 0.5rem;
  }
  
  .category-icon {
    background: #f0f0f0 !important;
    color: #333 !important;
  }
}

/* Analytics Summary Section */
.analytics-summary {
  margin-bottom: 2rem;
}

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

.analytics-summary .stat-item {
  text-align: center;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.analytics-summary .stat-value {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
  font-family: var(--font-heading);
}

.analytics-summary .stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* Insights Container */
.insights-container {
  background: linear-gradient(135deg, rgba(61,59,243,0.05), rgba(150,148,255,0.05));
  border-radius: 12px;
  padding: 1.5rem;
  border-left: 4px solid var(--primary);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.insight-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

.insight-item:last-child {
  margin-bottom: 0;
}

.insight-item h5 {
  margin: 0 0 0.5rem 0;
  color: var(--text-secondary);
  font-family: var(--font-heading);
}

.insight-item p {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.help-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.help-section {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.help-section h2 {
  color: var(--primary);
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.help-section h3 {
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.feature-card {
  background: rgba(61, 59, 243, 0.05);
  border-left: 4px solid var(--primary);
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 8px;
}

.feature-card h4 {
  color: var(--primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-card .icon {
  font-size: 1.2rem;
  color: var(--primary);
}

.usage-steps {
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.usage-steps ol {
  margin: 0;
  padding-left: 1.5rem;
}

.usage-steps li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.tip-box {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border-left: 4px solid #2196f3;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 8px;
}

.tip-box h5 {
  color: #1976d2;
  margin-bottom: 0.5rem;
}

.warning-box {
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  border-left: 4px solid #ff9800;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 8px;
}

.warning-box h5 {
  color: #f57c00;
  margin-bottom: 0.5rem;
}

.back-button {
  position: fixed;
  top: 2rem;
  left: 2rem;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.back-button:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

.analytics-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.overview-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-left: 4px solid var(--primary);
}

.overview-card h4 {
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.notif-wrapper{
  position:absolute; top:20px; right:30px; z-index:1000;
}
.notif-bell{ width:36px; height:auto; filter:invert(100%); cursor:pointer; }

.notif-badge{
  position:absolute; top:-6px; right:-6px;
  background:#000; color:#fff;
  border-radius:999px; padding:2px 6px;
  font-size:12px; font-weight:700;
  box-shadow:0 0 4px rgba(0,0,0,.4);
}

/* Notification dropdown */
#notificationDropdown {
  /* size & layout */
  position: absolute;               
  right: 0;
  margin-top: 10px;
  width: 320px;                     
  max-height: 420px;                
  display: none;
  overflow: hidden;
  /* look */
  background: #ffffff;
  color: #141414;
  border: 1px solid rgba(46, 46, 236, 0.15);
  border-radius: 16px;
  box-shadow:
    0 12px 28px rgba(0,0,0,.18),
    0 2px 8px rgba(46,46,236,.10);
  backdrop-filter: saturate(120%) blur(3px);
  z-index: 3000;
  transform-origin: top right;
  animation: notif-drop 160ms ease-out;
}
@keyframes notif-drop {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* header bar with your gradient */
#notificationDropdown > .notif-header {
  padding: 12px 14px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(90deg, #6a5cff 0%, #2e2eec 100%);
  border-bottom: 1px solid rgba(255,255,255,.15);
}

/* list area */
#notificationDropdown .notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 300px;
  overflow-y: auto;
}
#notificationDropdown .notif-list li {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f2f6;
  font-size: 14px;
  line-height: 1.35;
}

body[data-season="dark"] .amount-value {
  color: #e0e0e0;
}

body[data-season="dark"] .amount-percentage {
  color: #aaa;
}

/* Responsive Design for Analytics */
@media (max-width: 992px) {
  .category-view-toggle .toggle-buttons {
    flex-direction: column;
    width: 200px;
  }
  
  .category-icon {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
  
  .chart-container {
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .analytics-summary .summary-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .category-view-toggle .toggle-buttons {
    width: 100%;
    max-width: 300px;
  }
  
  .insights-container {
    padding: 1rem;
  }
  
  .category-item.plaid-enhanced {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .category-info {
    width: 100%;
  }
  
  .category-amount {
    align-self: stretch;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
  
.chart-wrapper {
  height: 300px;
}
}

@media (max-width: 480px) {
  .category-icon {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }
  
  .insight-item span {
    font-size: 0.85rem;
  }
  
  .category-view-toggle .toggle-btn {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
  }
  
  .chart-wrapper {
    height: 250px;
  }
}

.verification-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 999999 !important;
  background: rgba(0, 0, 0, 0.8) !important;
}

.verification-modal .modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 999999 !important;
}

/* Period Selector Styles */
.period-selector {
  margin-bottom: 2rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(61,59,243,0.03), rgba(150,148,255,0.03));
  border-radius: 12px;
  border: 1px solid rgba(61,59,243,0.1);
}

.period-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  justify-content: center;
}

.period-tab {
  padding: 0.6rem 1.rem;
  border: 1px solid var(--border-color, #dee2e6);
  background: var(--card-bg, #fff);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary, #666);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
#notificationDropdown .notif-actions {
  display: flex;
  justify-content: flex-start; 
  align-items: center;        
  gap: 5px;                  
  padding: 8px 10px;         
  border-top: 1px solid rgba(0,0,0,0.1);
  background: var(--card-bg, #fff);
  border-radius: 0 0 12px 12px !important;
  box-sizing:border-box;
}

#notificationDropdown .btn-small {
  border: none;
  outline: none;
  border-radius: 999px;
  padding: 0.70rem 1.6rem;
  font-size: 0.80rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 128px; 
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  line-height: 1;
}
/* "Mark all read" button */
#notificationDropdown .btn-primary {
  background: linear-gradient(90deg, var(--primary-light, #6d5dfc), var(--primary, #3a2ff7));
  color: #fff;
}
#notificationDropdown .btn-primary:hover {
  filter: brightness(0.9);
  transform: translateY(-1px);
}

/*"Clear" button */
#notificationDropdown .btn-danger {
  background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
  color: #fff;
}
#notificationDropdown .btn-danger:hover {
  filter: brightness(0.9);
  transform: translateY(-1px);
}


/* Dark mode(optional) */
body.dark #notificationDropdown {
  background: #0f1116; color: #f3f5fa; border-color: rgba(255,255,255,.08);
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
}
body.dark #notificationDropdown .notif-list li { border-bottom-color: #1b2030; }
body.dark #notificationDropdown .notif-actions { border-top-color: #1b2030; }
#bg-chat-launcher{
  position: fixed; right: 20px; bottom: 20px; z-index: 3000;
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,.25); font-size: 22px; background: #2e2eec; color: #fff;
}

.period-tab:hover {
  background: rgba(61,59,243,0.08);
  border-color: var(--primary, #3D3BF3);
  color: var(--text, #000);
  transform: translateY(-1px);
}
/* Slide-out */
#bg-chat-panel{
  position: fixed; right: -360px; bottom: 20px; width: 340px; height: 520px; z-index: 3001;
  background: #fff; border-radius: 16px; box-shadow: 0 12px 28px rgba(0,0,0,.25);
  display: flex; flex-direction: column; transition: right .25s ease;
}

.period-tab.active {
  background: var(--primary, #3D3BF3);
  color: white;
  border-color: var(--primary, #3D3BF3);
  box-shadow: 0 2px 8px rgba(61,59,243,0.3);
}

.period-tab i {
  font-size: 0.9rem;
}

.period-label {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-secondary, #666);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.period-label i {
  color: var(--primary, #3D3BF3);
}

/* Date Picker Modal Styles */
.date-picker-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}

.date-picker-modal .modal-content {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.date-picker-modal .modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color, #eee);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.date-picker-modal .modal-header h3 {
  margin: 0;
  color: var(--text, #333);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.date-picker-modal .modal-header h3 i {
  color: var(--primary, #3D3BF3);
}

.date-picker-modal .close-button {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary, #666);
  padding: 0 0.5rem;
  transition: color 0.2s;
}

.date-picker-modal .close-button:hover {
  color: var(--danger, #FF2929);
}

.date-picker-modal .modal-body {
  padding: 1.5rem;
}

.date-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.date-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.date-input-group label {
  font-weight: 500;
  color: var(--text, #333);
  font-size: 0.9rem;
}

.date-input-group input[type="date"] {
  padding: 0.6rem;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--card-bg, #fff);
  color: var(--text, #333);
  transition: border-color 0.2s;
}

.date-input-group input[type="date"]:focus {
  outline: none;
  border-color: var(--primary, #3D3BF3);
  box-shadow: 0 0 0 3px rgba(61,59,243,0.1);
}

.quick-ranges {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color, #eee);
}

.quick-ranges h4 {
  margin: 0 0 0.75rem 0;
  color: var(--text-secondary, #666);
  font-size: 0.9rem;
  font-weight: 500;
}

.quick-ranges button {
  margin: 0.25rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color, #ddd);
  background: var(--card-bg, #fff);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text, #333);
  transition: all 0.2s;
}

.quick-ranges button:hover {
  background: var(--primary, #3D3BF3);
  color: white;
  border-color: var(--primary, #3D3BF3);
  transform: translateY(-1px);
}

.date-picker-modal .modal-actions {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Enhanced Summary Stats */
.analytics-summary .summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.analytics-summary .stat-item {
  text-align: center;
  padding: 1.2rem 0.8rem;
  background: var(--card-bg, #fff);
  border-radius: 10px;
  border: 1px solid var(--border-color, #e9ecef);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: all 0.2s ease;
}

.analytics-summary .stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: var(--primary, #3D3BF3);
}

.analytics-summary .stat-value {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 0.3rem;
  font-family: var(--font-heading);
}

.analytics-summary .stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary, #666);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* Monthly Comparison Chart Container */
.chart-container {
  margin: 1.5rem 0;
  background: var(--card-bg, #fff);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border-color, #e9ecef);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.chart-container h4 {
  margin-bottom: 1rem;
  color: var(--text, #333);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.chart-container h4 i {
  color: var(--primary, #3D3BF3);
}

.chart-wrapper {
  position: relative;
  width: 100%;
}

/* Dark Mode Support */
body[data-season="dark"] .period-selector {
  background: linear-gradient(135deg, rgba(61,59,243,0.1), rgba(150,148,255,0.1));
  border-color: rgba(61,59,243,0.2);
}

body[data-season="dark"] .period-tab {
  background: #1e1e1e;
  border-color: #333;
  color: #aaa;
}

body[data-season="dark"] .period-tab:hover {
  background: rgba(100, 181, 246, 0.1);
  border-color: #64b5f6;
  color: #e0e0e0;
}

body[data-season="dark"] .period-tab.active {
  background: #64b5f6;
  color: #1e1e1e;
  border-color: #64b5f6;
}

body[data-season="dark"] .period-label {
  color: #aaa;
}

body[data-season="dark"] .period-label i {
  color: #64b5f6;
}

body[data-season="dark"] .date-picker-modal .modal-content {
  background: #1e1e1e;
  color: #e0e0e0;
}

body[data-season="dark"] .date-picker-modal .modal-header {
  border-bottom-color: #333;
}

body[data-season="dark"] .date-picker-modal input[type="date"] {
  background: #2a2a2a;
  border-color: #333;
  color: #e0e0e0;
}

body[data-season="dark"] .date-picker-modal input[type="date"]:focus {
  border-color: #64b5f6;
  box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.2);
}

body[data-season="dark"] .quick-ranges {
  border-top-color: #333;
}

body[data-season="dark"] .quick-ranges button {
  background: #2a2a2a;
  border-color: #333;
  color: #e0e0e0;
}

body[data-season="dark"] .quick-ranges button:hover {
  background: #64b5f6;
  color: #1e1e1e;
  border-color: #64b5f6;
}

body[data-season="dark"] .analytics-summary .stat-item {
  background: #1e1e1e;
  border-color: #333;
}

body[data-season="dark"] .analytics-summary .stat-item:hover {
  border-color: #64b5f6;
}

body[data-season="dark"] .chart-container {
  background: #1e1e1e;
  border-color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
  .period-tabs {
    gap: 0.3rem;
  }
  
  .period-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
  
  .period-tab i {
    font-size: 0.8rem;
  }
  
  .date-inputs {
    grid-template-columns: 1fr;
  }
  
  .analytics-summary .summary-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .chart-wrapper {
    height: 200px !important;
  }
}

@media (max-width: 480px) {
  .period-tabs {
    flex-direction: column;
  }
  
  .period-tab {
    width: 100%;
    justify-content: center;
  }
  
  .analytics-summary .stat-item {
    padding: 0.8rem 0.5rem;
  }
  
  .analytics-summary .stat-value {
    font-size: 1.1rem;
  }
  
  .analytics-summary .stat-label {
    font-size: 0.75rem;
  }
}

/* Print Styles */
@media print {
  .period-selector {
    border: 1px solid #ddd;
  }
  
  .period-tab {
    display: none;
  }
  
  .period-tab.active {
    display: block;
    background: #f0f0f0 !important;
    color: #333 !important;
  }
  
  .chart-container {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
#bg-chat-form{ display:flex; gap:8px; padding: 10px; border-top:1px solid #eee; }
#bg-chat-input{ flex:1; padding:10px; border:1px solid #ddd; border-radius:10px; }
#bg-chat-form .send{ background:#2e2eec; color:#fff; border:none; border-radius:10px; padding:0 14px; cursor:pointer; }

:root { --control-size: 18px; }   

#twofa-method-row .twofa-title {
  margin-bottom: .35rem;
  font-weight: 700;
}

.toggle-row{
  display: flex;
  align-items: center;               /* centers cross-axis */
  gap: .6rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  margin: .25rem 0;
  line-height: var(--control-size);  /* text line height = radio size */
}

.toggle-row input[type="radio"]{
  width: var(--control-size);
  height: var(--control-size);
  margin: 0;
  accent-color: var(--primary);
  transform: translateY(4px);        /* horizontal placement */
}

.toggle-row span{
  line-height: var(--control-size);
  display: inline-block;
}

.twofa-inline label {
  color: var(--text) !important; /* use theme text color */
}

#twofa-method-row .toggle-row span {
  color: var(--text) !important;
}

.twofa-section h3,
.twofa-section h4 {
  color: var(--text) !important;
  border-left-color: rgba(0,0,0,.18);
}

.card li,
.card .settings-item {
  list-style: none;         /* getting rid of prof pages bullets */
  padding-left: 0;
  margin-left: 0;
}

.card li::marker {
  content: '';
}
.bb-tx-list { display:flex; flex-direction:column; gap:10px; }
.bb-tx { padding:10px; border-radius:10px; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.06); border:1px solid #eee; }
.bb-tx-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.bb-tx-desc { font-weight:600; line-height:1.2; word-break:break-word; }
.bb-tx-meta { margin-top:4px; font-size:12px; color:#666; display:flex; gap:8px; align-items:center; }
.bb-badge { display:inline-block; padding:2px 8px; border-radius:999px; background:#f2f4f7; color:#334155; font-size:12px; border:1px solid #e5e7eb; }
.bb-amt-neg { color:#b00020; font-weight:700; }
.bb-amt-pos { color:#0a7; font-weight:700; }
.bb-amt-zero { color:#555; font-weight:700; }
.bb-empty { padding:8px; color:#777; }

/* Table variant */
.bb-tbl { border:1px solid #eee; border-radius:10px; overflow:hidden; background:#fff; }
.bb-tbl-row { display:grid; grid-template-columns: 120px 1fr 160px 120px; gap:12px; padding:8px 10px; border-top:1px solid #f3f4f6; }
.bb-tbl-head { background:#f8fafc; font-weight:700; border-top:none; }
@media (max-width: 520px) {
  .bb-tbl-row { grid-template-columns: 100px 1fr 120px 100px; }
}

/* reCAPTCHA container styling */
.recaptcha-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  min-height: 78px; /* Standard reCAPTCHA height */
}

/* Ensure reCAPTCHA fits well in your form */
.g-recaptcha {
  transform: scale(0.95);
  transform-origin: center;
}

/* For mobile responsiveness */
@media (max-width: 480px) {
  .g-recaptcha {
    transform: scale(0.85);
    transform-origin: center;
  }
  
  .recaptcha-container {
    margin: 15px 0;
    overflow: hidden;
  }
}

/* Very small screens */
@media (max-width: 350px) {
  .g-recaptcha {
    transform: scale(0.75);
    transform-origin: center;
  }
}

/* Dark theme support for reCAPTCHA if your site uses dark theme */
.dark .g-recaptcha {
  filter: invert(1) hue-rotate(180deg);
}

/* Enhanced error message styling */
#error-message:not(:empty) {
  padding: 12px;
  border-radius: 6px;
  background-color: rgba(255, 0, 0, 0.1);
  border: 1px solid var(--danger);
  margin-bottom: 1rem;
  font-size: 14px;
}

/* Success message styling (for when you add success messages) */
.success-message {
  padding: 12px;
  border-radius: 6px;
  background-color: rgba(0, 255, 0, 0.1);
  border: 1px solid #28a745;
  color: #28a745;
  text-align: center;
  margin-bottom: 1rem;
  font-size: 14px;
}

/* Loading state for form buttons */
.btn.loading {
  opacity: 0.6;
  cursor: not-allowed;
  position: relative;
  pointer-events: none;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  margin: auto;
  border: 2px solid transparent;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: button-loading-spinner 1s ease infinite;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

@keyframes button-loading-spinner {
  from {
    transform: rotate(0turn);
  }
  to {
    transform: rotate(1turn);
  }
}

/* 2FA Modal enhancements */
.modal {
  z-index: 9999;
}

.modal-content {
  animation: modalFadeIn 0.3s ease-out;
}

.modal.hide .modal-content {
  animation: modalFadeOut 0.2s ease-in;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-50px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalFadeOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.8) translateY(-50px);
  }
}

/* Ensure reCAPTCHA doesn't break layout in different form states */
.login-card {
  min-height: auto;
  transition: height 0.3s ease;
}

/* reCAPTCHA focus styles for accessibility */
.g-recaptcha:focus-within {
  outline: 2px solid var(--primary, #007bff);
  outline-offset: 2px;
  border-radius: 4px;
}
/*New chat header with new Timer for no rearagging so no more bugs bugs*/
.bg-chat-panel {
  position: fixed; bottom: 20px; right: 20px;
  width: 360px; max-height: 520px;
  display: none; 
  background:#fff; border-radius:12px; overflow:hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 9999;
  font-family: var(--font-heading, "Roboto Slab"), serif;
}
.bg-chat-panel.open { display: flex; flex-direction: column; }

.bg-chat-header {
  display:flex; align-items:center; justify-content:space-between;
  gap:.75rem; padding:.6rem .75rem;
  background: linear-gradient(to right, #4b6cb7, #182848); color:#fff;
}
.bg-chat-header strong { font-weight: 800; letter-spacing:.2px; }

.bb-controls { display:flex; align-items:center; gap:.5rem; }
.bb-timer-label { display:inline-flex; align-items:center; gap:.35rem; min-width:72px; justify-content:flex-end; }

#bb-start, #bb-end, #bg-chat-close {
  border:0; border-radius:6px; padding:.35rem .55rem; font-weight:600; cursor:pointer;
}
#bb-start { background:#fff2; color:#fff; }
#bb-start:disabled { opacity:.55; cursor:default; }
#bb-end { background:#ffffff; color:#182848; }
#bb-end:disabled { opacity:.55; cursor:default; }

#bg-chat-close { background:transparent; color:#fff; font-size:18px; line-height:1; padding:.1rem .4rem; }

.bg-chat-log { flex:1; overflow:auto; padding:.75rem; background:#f9f9f9; }
.bg-chat-form { display:flex; gap:.5rem; padding:.6rem; background:#eee; }
.bg-chat-form input { flex:1; border:1px solid #ccc; border-radius:8px; padding:.55rem .7rem; }
.bg-chat-form .send { border:0; border-radius:8px; padding:.55rem .8rem; background:#4b6cb7; color:#fff; }

.bg-chat-panel .ai, .bg-chat-panel .me { margin:.35rem 0; padding:.5rem .65rem; border-radius:8px; }
.bg-chat-panel .ai { background:#fff; }
.bg-chat-panel .me { background:#e8f0fe; align-self:flex-end; }

.suggest { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:.35rem; }
.suggest-btn { border:1px solid #ddd; background:#fff; border-radius:999px; padding:.35rem .6rem; cursor:pointer; }

.chart-wrapper {
  max-width: 1000px;
  margin: 0 auto;
}

#spending-chart {
  max-width: 100%;
  max-height: 600px;
}

/* Enhanced Category Breakdown Styles */
.category-breakdown {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  overflow: hidden;
}

.category-breakdown h4 {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  padding: 1.5rem;
  margin: 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  font-size: 1.3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.category-breakdown h4::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
  animation: categoryShimmer 3s ease-in-out infinite;
}

@keyframes categoryShimmer {
  0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

#category-list {
  padding: 0;
  margin: 0;
}

.category-item.enhanced-item {
  display: flex;
  align-items: center;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-color, #e9ecef);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  background: var(--card-bg);
}

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

.category-item.enhanced-item:hover {
  background: var(--background-hover, #f8f9fa);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-item.enhanced-item:hover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
}

.category-item .category-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  font-size: 1.2rem;
  color: white;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.category-item .category-icon::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.3;
  transform: scale(0);
  transition: transform 0.3s ease;
}

.category-item.enhanced-item:hover .category-icon::after {
  transform: scale(1.1);
}

.category-item .category-details {
  flex: 1;
  min-width: 0;
}

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

.category-item .category-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-item .category-amount-section {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.category-item .category-amount {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--danger);
  font-family: var(--font-heading);
}

.category-item .category-percentage {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--background-hover, #f8f9fa);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.category-item .category-percentage::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
  transition: left 0.5s ease;
}

.category-item.enhanced-item:hover .category-percentage::before {
  left: 100%;
}

.category-item .progress-bar {
  width: 80px;
  height: 4px;
  background: var(--border-color, #e9ecef);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.category-item .progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
  position: relative;
}

.category-item .progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: progressShimmer 2s infinite;
}

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

/* Empty state styling */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
  color: var(--text-secondary);
}

.empty-state p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Category-specific colors (keeping your existing color scheme) */
.category-item .food-dining,
.category-item .food-amp-dining { 
  background: #FF6B6B !important; 
}

.category-item .services { 
  background: #6366f1 !important; 
}

.category-item .shopping { 
  background: #45B7D1 !important; 
}

.category-item .entertainment { 
  background: #F7DC6F !important; 
  color: #333 !important; 
}

.category-item .transportation { 
  background: #4ECDC4 !important; 
}

.category-item .debt-payments { 
  background: #f59e0b !important; 
}

.category-item .transfers { 
  background: #85C1E9 !important; 
}

.category-item .healthcare { 
  background: #BB8FCE !important; 
}

.category-item .bills-amp-utilities { 
  background: #8b5cf6 !important; 
}

.category-item .home-amp-garden { 
  background: #22c55e !important; 
}

.category-item .education { 
  background: #82E0AA !important; 
}

.category-item .government-amp-taxes { 
  background: #D2B4DE !important; 
}

.category-item .other { 
  background: #BDC3C7 !important; 
}

/* Dark mode support */
body[data-season="dark"] .category-breakdown {
  background: #1e1e1e;
  border: 1px solid #333;
}

body[data-season="dark"] .category-breakdown h4 {
  background: linear-gradient(135deg, #64b5f6, #1976d2);
}

body[data-season="dark"] .category-item.enhanced-item {
  background: #1e1e1e;
  border-bottom-color: #333;
  color: #e0e0e0;
}

body[data-season="dark"] .category-item.enhanced-item:hover {
  background: #2a2a2a;
}

body[data-season="dark"] .category-item .category-name {
  color: #e0e0e0;
}

body[data-season="dark"] .category-item .category-meta {
  color: #aaa;
}

body[data-season="dark"] .category-item .category-amount {
  color: #ff7a7a;
}

body[data-season="dark"] .category-item .category-percentage {
  background: rgba(255, 255, 255, 0.1);
  color: #aaa;
}

body[data-season="dark"] .category-item .progress-bar {
  background: #333;
}

body[data-season="dark"] .empty-state {
  color: #aaa;
}

/* Responsive design */
@media (max-width: 768px) {
  .category-item.enhanced-item {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .category-item .category-icon {
    margin-right: 0.75rem;
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .category-item .category-amount-section {
    align-self: stretch;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  .category-item .progress-bar {
    width: 60px;
  }
}

@media (max-width: 480px) {
  .category-breakdown h4 {
    font-size: 1.1rem;
    padding: 1rem;
  }

  .category-item .category-icon {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    margin-right: 0.5rem;
  }

  .category-item .category-name {
    font-size: 0.9rem;
  }

  .category-item .category-meta {
    font-size: 0.8rem;
  }

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

  .category-item .category-percentage {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
  }
}
.recurring-entry {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border-light, #f0f0f0);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.recurring-entry:hover {
  background: var(--background-hover, #f8f9fa);
  border-color: var(--primary, #007bff);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.recurring-icon {
  color: var(--primary, #007bff);
  font-size: 1.1rem;
}

.recurring-details {
  flex: 1;
}

.recurring-name {
  font-weight: 500;
  color: var(--text-primary, #333);
  margin-bottom: 0.25rem;
}

.recurring-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
}

.badge {
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-confirmed {
  background: #d4edda;
  color: #155724;
}

.badge-potential {
  background: #fff3cd;
  color: #856404;
}

.recurring-frequency {
  color: var(--text-secondary, #666);
}
