/* === ROOT VARIABLES === */
:root {
  --color-primary: #8e270e; /* Terracotta */
  --color-accent: #16a34a; /* Green */
  --color-bg: #f3f4f6; /* Background */
  --color-surface: #ffffff; /* Surface white */
  --color-border: #e5e7eb;
  --color-text-dark: #0f172a;
  --color-text-light: #475569;
  --color-success: #10b981;
  --color-warning: #f59e0b;

  --font-body: 'work.woff2', 'Inter', system-ui, sans-serif;
  --font-heading: 'Poppins', sans-serif;

  --radius: 10px;
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
}
=======
/* ===================================================================
   BALANCR UNIFIED STYLESHEET
   Theme: Blue (#2563EB) + Green (#16A34A)
   Sections: Variables / Reset / Auth & App / Public Landing / Footer
   =================================================================== */

/* === FONT FACE === */
@font-face {
  font-family: 'Work Sans';
  src: url('work.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* === ROOT VARIABLES === */
:root {
  --color-primary: #8e270e; /* Terracotta */
  --color-accent: #16a34a; /* Green */
  --color-bg: #f3f4f6; /* Background */
  --color-surface: #ffffff; /* Surface white */
  --color-border: #e5e7eb;
  --color-text-dark: #0f172a;
  --color-text-light: #475569;
  --color-success: #10b981;
  --color-warning: #f59e0b;

  --font-body: 'Work Sans', 'Inter', system-ui, sans-serif;
  --font-heading: 'Poppins', sans-serif;

  --radius: 10px;
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
}
=================================================================== */

/* === ROOT VARIABLES === */
:root {
  --color-primary: #8e270e; /* Terracotta */
  --color-accent: #16a34a; /* Green */
  --color-bg: #f3f4f6; /* Background */
  --color-surface: #ffffff; /* Surface white */
  --color-border: #e5e7eb;
  --color-text-dark: #0f172a;
  --color-text-light: #475569;
  --color-success: #10b981;
  --color-warning: #f59e0b;

  --font-body: 'work.woff2', 'Inter', system-ui, sans-serif;
  --font-heading: 'Poppins', sans-serif;

  --radius: 10px;
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
}

/* === RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body {
  min-height: 100%;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}
img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === UTILS === */
.hidden {
  display: none !important;
}
.container {
  max-width: 95%;
  margin: 0 auto;
  padding: 0 2rem;
}
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover {
  transform: translateY(-2px);
}
.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.btn-secondary:hover {
  background: var(--color-primary);
  color: #fff;
}

/* === UI CREATION MANAGER === */
.component-selection-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.component-selection-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.component-selection-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.component-selection-details {
  flex: 1;
}

.component-selection-name {
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.25rem;
}

.component-selection-description {
  font-size: 0.9rem;
  color: #64748b;
}

.component-owner-badge {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-left: 0.5rem;
}

.component-selection-actions {
  display: flex;
  gap: 0.5rem;
}

.component-action-btn {
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.component-action-btn:hover {
  background: #f1f5f9;
  border-color: #9ca3af;
}

.component-action-btn:hover.delete {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

/* === UI COMPONENT SYSTEM === */
main_ui {
  display: block;
  min-height: 400px;
  padding: 1rem;
}

.ui-component {
  background: var(--color-surface);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-soft);
  position: relative;
  transition: var(--transition);
}

.ui-component:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.ui-component-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: var(--radius) var(--radius) 0 0;
}

.ui-component-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-dark);
  margin: 0;
}

.ui-component-controls {
  display: flex;
  gap: 0.5rem;
}

.ui-control-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.8rem;
  color: var(--color-text-light);
}

.ui-control-btn:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.ui-control-btn.remove:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.ui-component-content {
  padding: 1.5rem;
}

.ui-loading {
  text-align: center;
  padding: 3rem;
  color: var(--color-text-light);
}

.ui-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: #dc2626;
}

/* === FOOTER MENU === */
footer_menu {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1rem 0;
  position: sticky;
  bottom: 0;
  z-index: 100;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.footer-nav-btn {
  background: transparent;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  color: var(--color-text-light);
  flex: 1;
  max-width: 150px;
}

.footer-nav-btn:hover,
.footer-nav-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* === FOOTER WORKSPACE === */
footer_workspace {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  min-height: 120px;
  padding: 1rem 0;
}

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

.workspace-section {
  display: none;
}

.workspace-section.active {
  display: block;
}

.workspace-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.workspace-action-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  min-width: 120px;
}

.workspace-action-btn:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* ============================================================
   AUTH & APP AREA
   ============================================================ */

/* === AUTH BOX === */
.auth-box {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 420px;
  margin: 6rem auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}
.auth-box h1 {
  color: var(--color-primary);
  text-align: center;
  font-size: 2.4rem;
  margin-bottom: 1.5rem;
}
.auth-box h2 {
  color: var(--color-text-dark);
  margin-bottom: 1rem;
}
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
input,
select,
textarea {
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  font-size: 1rem;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}
button {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}
button:hover {
  background: var(--color-accent);
}

/* === APP CONTAINER === */
#app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text-dark);
}

/* === HEADER === */
#app-container header {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}
#app-container header h1 {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.6rem;
  font-weight: 700;
}

/* === USER DROPDOWN === */
.user-info {
  position: relative;
}
.dropdown-toggle {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s;
}
.dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}
.dropdown-menu {
  position: absolute;
  top: 110%;
  right: 0;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
  overflow: hidden;
  z-index: 50;
}
.dropdown-menu a,
.dropdown-menu button {
  display: block;
  width: 100%;
  padding: 0.8rem 1rem;
  color: var(--color-text-dark);
  text-align: left;
  background: none;
  border: none;
}
.dropdown-menu a:hover,
.dropdown-menu button:hover {
  background: #f1f5f9;
}

/* === MAIN === */
#app-container main {
  flex-grow: 1;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.8rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease;
}
section:hover {
  transform: translateY(-2px);
}
section h2 {
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 1rem;
}

/* === TABLES === */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  border-radius: var(--radius);
  overflow: hidden;
}
thead {
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  color: #fff;
}
th,
td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
tbody tr:hover {
  background: #f9fafb;
}

/* === MODAL === */
/* === MODAL STYLES === */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 5%;
  z-index: 1000;
}

.modal-content {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  animation: fadeInUp 0.3s ease;
  width: 90%;
  max-height: 90%;
  overflow: auto;
  max-width: 800px;
}

.modal-content h2 {
  color: var(--color-primary);
  margin-bottom: 2rem;
  text-align: center;
  font-size: 1.8rem;
}

/* === BUDGET CREATION SECTIONS === */
.budget-info-section,
.category-creation-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border-radius: 12px;
  border: 2px solid var(--color-border);
  background: linear-gradient(135deg, #fafbfc 0%, #f8fafd 100%);
}

.budget-info-section {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.category-creation-section {
  border-color: #10b981;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.section-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.section-header h3 {
  color: var(--color-text-dark);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-description {
  color: var(--color-text-light);
  font-size: 0.95rem;
  margin: 0;
  font-style: italic;
}

/* === FORM LAYOUT === */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

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

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-weight: 600;
  color: var(--color-text-dark);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.875rem;
  border-radius: 8px;
  border: 2px solid var(--color-border);
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small {
  color: var(--color-text-light);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* === CATEGORY FORM CONTAINER === */
.category-form-container {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  margin-bottom: 1.5rem;
}

/* === CATEGORIES PREVIEW === */
.categories-preview {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.categories-preview h4 {
  color: var(--color-text-dark);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.income-expense-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.income-section,
.expense-section {
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.income-section {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #16a34a;
}

.expense-section {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-color: #dc2626;
}

.income-section h5,
.expense-section h5 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--color-text-dark);
}

.category-list {
  min-height: 60px;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  border: 1px dashed var(--color-border);
}

/* === FORM ACTIONS === */
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding-top: 1.5rem;
  border-top: 2px solid var(--color-border);
  margin-top: 2rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #1d4ed8);
  color: white;
  border: none;
  padding: 0.875rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: white;
  color: var(--color-text-dark);
  border: 2px solid var(--color-border);
  padding: 0.875rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    padding: 1.5rem;
    margin: 1rem;
  }

  .form-grid,
  .form-row,
  .income-expense-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === STAT CARDS === */
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-align: center;
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
}
.stat-card h3 {
  color: var(--color-text-light);
  font-size: 0.9rem;
}
.stat-card .value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-primary);
}
.stat-item .value {
  font-size: 1.8rem;
  font-weight: 700;
  color: red;
}
/* === SYNC STATUS === */
.sync-status {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 50px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-soft);
}
#sync-indicator.online {
  color: var(--color-accent);
}
#sync-indicator.offline {
  color: var(--color-warning);
}

/* ============================================================
   PUBLIC LANDING (LOGGED OUT)
   ============================================================ */

.public-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.app-title {
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--color-primary);
}

/* === HERO CAROUSEL === */
.hero-carousel {
  position: relative;
  overflow: hidden;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8fafc, #ecfdf5);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 4rem;
}
.carousel-track {
  display: flex;
  width: 300%;
  animation: slideShow 18s infinite;
}
@keyframes slideShow {
  0%,
  30% {
    transform: translateX(0%);
  }
  35%,
  65% {
    transform: translateX(-33.333%);
  }
  70%,
  100% {
    transform: translateX(-66.666%);
  }
}
.slide {
  flex: 0 0 100%;
  text-align: center;
  padding: 2rem;
}
.slide h2 {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-text-dark);
}
.slide .highlight {
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.slide p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--color-text-light);
  font-size: 1.1rem;
}
.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.6rem;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d1d5db;
  animation: dotPulse 18s infinite;
}
@keyframes dotPulse {
  0%,
  5% {
    background: var(--color-primary);
  }
  30%,
  100% {
    background: #d1d5db;
  }
}
.dot:nth-child(2) {
  animation-delay: 6s;
}
.dot:nth-child(3) {
  animation-delay: 12s;
}

/* === FEATURES === */
.features {
  text-align: center;
  padding: 4rem 2rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}
.features h3 {
  font-size: 2rem;
  margin-bottom: 2rem;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}
.feature-item {
  background: #f9fafb;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  transition: var(--transition);
}
.feature-item:hover {
  transform: translateY(-6px);
  border-color: var(--color-primary);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
}
.feature-item h4 {
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

/* === TESTIMONIALS === */
.testimonials {
  background: linear-gradient(135deg, #f8fafc, #ffffff);
  padding: 5rem 2rem;
  text-align: center;
  border-radius: 12px;
  margin-top: 4rem;
}
.testimonials h3 {
  font-size: 2rem;
  margin-bottom: 2.5rem;
}
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.testimonial-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}
.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
.testimonial-card p {
  font-style: italic;
  color: var(--color-text-light);
  margin-bottom: 1rem;
}
.testimonial-card h5 {
  color: var(--color-primary);
  font-weight: 600;
}

/* === CTA SECTION === */
.cta-section {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
  text-align: center;
  padding: 5rem 2rem;
  border-radius: 12px;
  margin-top: 5rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}
.cta-section h3 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}
.cta-section p {
  font-size: 1.1rem;
  color: #e0f2fe;
  margin-bottom: 2rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.public-footer {
  background: #1e293b;
  color: #e2e8f0;
  padding: 4rem 2rem 2rem;
  border-top: 4px solid var(--color-accent);
  margin-top: 4rem;
}
.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
}
.footer-section h5 {
  color: #fff;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}
.footer-logo {
  color: var(--color-accent);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.footer-about {
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.6;
}
.footer-socials {
  display: flex;
  gap: 1rem;
}
.social-link {
  font-size: 1.5rem;
  color: #94a3b8;
  text-decoration: none;
  transition: var(--transition);
}
.social-link:hover {
  transform: translateY(-3px);
  color: var(--color-accent);
}
.footer-bottom {
  text-align: center;
  border-top: 1px solid #334155;
  margin-top: 3rem;
  padding-top: 1.5rem;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* === ANIMATIONS === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  header,
  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  .hero-carousel {
    height: auto;
  }
  .slide h2 {
    font-size: 2rem;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  table {
    font-size: 0.9rem;
  }
}

/* Daily View Income Section Styling */
.daily-income-section {
  background: linear-gradient(135deg, #f6fffa 0%, #e0f7ea 100%);
  border: 2px solid #2d862d;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 6px 20px rgba(45, 134, 45, 0.15);
  position: relative;
  overflow: hidden;
}

.daily-income-section.negative {
  background: linear-gradient(135deg, #fff7f7 0%, #ffe0e0 100%);
  border: 2px solid #c33;
  box-shadow: 0 6px 20px rgba(195, 51, 51, 0.15);
}

.daily-income-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #2d862d, #16a34a);
}

.daily-income-section.negative::before {
  background: linear-gradient(90deg, #c33, #ff6b6b);
}

.income-card {
  transform: translateY(0);
  transition: all 0.3s ease;
}

.income-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(45, 134, 45, 0.2) !important;
}

.income-card.negative:hover {
  box-shadow: 0 8px 25px rgba(195, 51, 51, 0.2) !important;
}

.daily-income-row {
  background: linear-gradient(135deg, #f0fff0 0%, #e0f7ea 100%) !important;
  border-bottom: 3px solid #2d862d !important;
  position: relative;
}

.daily-income-row.negative {
  background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%) !important;
  border-bottom: 3px solid #c33 !important;
}

.daily-income-row::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #16a34a, transparent);
}

.daily-income-row.negative::after {
  background: linear-gradient(90deg, #c33, transparent);
}

.daily-income-separator {
  height: 12px;
  background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
  border-bottom: 1px solid #e9ecef;
}

/* Enhanced income card styling */
.income-card h3 {
  background: linear-gradient(135deg, #2d862d, #16a34a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.income-card.negative h3 {
  background: linear-gradient(135deg, #c33, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.income-card .amount {
  background: linear-gradient(135deg, #2d862d, #16a34a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.income-card.negative .amount {
  background: linear-gradient(135deg, #c33, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Mobile responsive for income sections */
@media (max-width: 768px) {
  .daily-income-section {
    margin-bottom: 1rem;
    padding: 1rem;
  }

  .income-card {
    margin-bottom: 1rem;
  }

  .income-card h3 {
    font-size: 1.2rem;
  }

  .income-card .amount {
    font-size: 1.5rem;
  }
}

/* ============================================================
   📱 BALANCR MOBILE OPTIMIZATION PATCH
   ============================================================ */
@media (max-width: 768px) {
  /* --- Header --- */
  .header-content,
  #app-container header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.8rem;
    padding: 1rem;
  }
  .app-title,
  #app-container header h1 {
    font-size: 1.4rem;
    line-height: 1.3;
  }

  /* --- Hero Carousel --- */
  .hero-carousel {
    height: auto;
    padding: 2rem 1rem;
  }
  .carousel-track {
    flex-direction: column;
    width: 100%;
    animation: none; /* prevent awkward slide cutoffs on mobile */
  }
  .slide {
    flex: 1 1 100%;
    padding: 1rem;
  }
  .slide h2 {
    font-size: 1.8rem;
  }
  .slide p {
    font-size: 1rem;
    line-height: 1.5;
  }
  .carousel-dots {
    display: none; /* hide dots to save vertical space */
  }

  /* --- Feature & Testimonial Grids --- */
  .features-grid,
  .testimonial-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .feature-item,
  .testimonial-card {
    padding: 1.25rem;
  }

  /* --- Hero CTA --- */
  .cta-section {
    padding: 3rem 1.5rem;
  }
  .cta-section h3 {
    font-size: 1.6rem;
  }
  .cta-section p {
    font-size: 1rem;
  }

  /* --- Tables & Sections --- */
  section {
    padding: 1.2rem;
    margin-bottom: 1.5rem;
  }
  table {
    font-size: 0.9rem;
    min-width: 600px;
  }
  .table-wrapper {
    overflow-x: auto;
  }

  /* --- Modals --- */
  .modal-content {
    width: 92%;
    padding: 1.5rem;
    border-radius: 10px;
  }
  .modal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .modal-header h2 {
    font-size: 1.2rem;
  }

  /* --- Footer --- */
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  .footer-socials {
    justify-content: center;
  }
  .footer-bottom {
    padding-top: 1rem;
    font-size: 0.8rem;
  }

  /* --- General scaling --- */
  h1,
  h2,
  h3 {
    line-height: 1.3;
  }
  p {
    font-size: 0.95rem;
  }
}

/* ============================================================
   📱 BALANCR MOBILE FIX PATCH v2 — container + card sizing
   ============================================================ */
@media (max-width: 768px) {
  /* --- App container and main layout --- */
  #app-container main {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
  }

  #app-container section,
  .auth-box,
  .budget-header,
  .stat-card,
  .transaction-item,
  .category-card {
    width: 100%;
    max-width: 100%;
    margin: 0 0 1rem 0;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  }

  /* --- Dropdown & header alignment --- */
  .user-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  .dropdown-menu {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  /* --- Tables and data views --- */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    font-size: 0.85rem;
  }

  /* --- Cards & blocks --- */
  .budget-header,
  .stat-card,
  .transaction-item {
    padding: 1rem;
  }

  /* --- Remove excessive outer margins --- */
  .container,
  #app-container {
    padding: 0;
    margin: 0;
  }

  /* --- Body background alignment --- */
  body {
    background: var(--color-bg);
  }
}

.budget-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 15px;
  padding: 14px;
}

.budget-info h5 {
  color: #555;
  font-size: 0.9em;
  font-weight: 600;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.budget-info span {
  color: #333;
  font-size: 1.1em;
  font-weight: 500;
}

.budget-name {
  color: #667eea;
  font-weight: 600;
}

.budget-description {
  color: #666;
  font-style: italic;
  line-height: 1.4;
}

.budget-date-range {
  color: #667eea;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.budget-date-range::before {
  content: '📅';
  font-size: 0.9em;
}
.date-range-inputs {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  justify-content: space-around;
  border-bottom: solid 1px black;
  padding-bottom: 10px;
}

.budget-type {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: 600;
}

.budget-type.public {
  background: #e3f2fd;
  color: #1976d2;
}

.budget-type.private {
  background: #f3e5f5;
  color: #7b1fa2;
}

/* ============================================================
   📱 BALANCR MOBILE TABLE SCROLL PATCH
   - Enables side-scroll for wide tables on small screens
   - Keeps headers visible (optional sticky)
   ============================================================ */
@media (max-width: 768px) {
  /* Make the table containers scroll horizontally */
  #income-table-container,
  #expenses-table-container,
  #daily-results,
  #budget-overview,
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    padding-bottom: 8px; /* space for scrollbar thumb */
    scrollbar-width: thin; /* Firefox */
  }

  /* Ensure the table is wider than the viewport so scrolling kicks in */
  #income-table,
  #expenses-table,
  #daily-table,
  #budget-table {
    width: max-content; /* grow to fit columns */
    min-width: 720px; /* adjust if you want more/less width */
    border-collapse: collapse; /* keep current look */
    table-layout: auto;
  }

  /* Slightly tighten cell padding for mobile */
  #income-table th,
  #income-table td,
  #expenses-table th,
  #expenses-table td,
  #daily-table th,
  #daily-table td,
  #budget-table th,
  #budget-table td {
    padding: 10px 12px;
    white-space: nowrap; /* keep columns compact */
  }

  /* Optional: sticky header so labels remain visible while scrolling vertically */
  #income-table thead th,
  #expenses-table thead th,
  #daily-table thead th,
  #budget-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
  }

  /* Optional: subtle mobile scrollbar styling (WebKit) */
  #income-table-container::-webkit-scrollbar,
  #expenses-table-container::-webkit-scrollbar,
  #daily-results::-webkit-scrollbar,
  #budget-overview::-webkit-scrollbar,
  .table-wrapper::-webkit-scrollbar {
    height: 8px;
  }
  #income-table-container::-webkit-scrollbar-thumb,
  #expenses-table-container::-webkit-scrollbar-thumb,
  #daily-results::-webkit-scrollbar-thumb,
  #budget-overview::-webkit-scrollbar-thumb,
  .table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
  }
}

/* ============================================================
   🖥️ BALANCR DESKTOP WIDTH ALIGNMENT FIX
   ============================================================ */
@media (min-width: 769px) {
  /* Make inner sections match header container width */
  #app-container main {
    max-width: 1200px; /* match .header-content width */
    margin: 0 auto;
    padding: 2rem;
  }

  /* Cards, tables, and sections expand to full width of main */
  #app-container section,
  .auth-box,
  .budget-header,
  .stat-card,
  .transaction-item,
  .category-card {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  /* Keep header consistent */
  #app-container header {
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 0 0 12px 12px;
  }

  /* Optional: give consistent spacing below header */
  #app-container main {
    margin-top: 1.5rem;
  }

  /* Prevent boxed layout background from shrinking */
  body {
    background: var(--color-bg);
  }
}

/* ============================================================
   📱 Preserve Mobile Fluidity & Scroll
   ============================================================ */
@media (max-width: 768px) {
  #app-container main {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
  }
  #app-container section {
    width: 100%;
  }
  #income-table-container,
  #expenses-table-container,
  #daily-results {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ============================================================
   🎯 BALANCR HERO ANIMATION: SCROLL TRIGGER MODE
   The hero’s chart animates only when scrolled into view.
   ============================================================ */

/* Default state: hidden / idle */
.hero-visual,
.hero-visual .hero-card,
.hero-card .bar,
.hero-card .pulse {
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.8s ease-out;
}

/* Activated once visible */
.hero-visual.animate-in,
.hero-visual.animate-in .hero-card,
.hero-visual.animate-in .bar,
.hero-visual.animate-in .pulse {
  opacity: 1;
  transform: translateY(0);
}

/* Restart existing floating animation when active */
.hero-visual.animate-in .hero-card {
  animation: floatPulse 4s ease-in-out infinite;
}

.hero-visual.animate-in .bar {
  animation: barGrow 1.8s ease-in-out infinite;
}

.hero-visual.animate-in .pulse {
  animation: glowPulse 3.5s ease-in-out infinite;
}

/* ============================================================
   💡 BALANCR HERO RESTORATION PATCH
   Restores side-by-side hero layout with animated chart.
   ============================================================ */

.hero {
  background: var(--color-surface);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  padding: 3rem 2.5rem;
  margin: 3rem auto;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  flex-wrap: wrap; /* keeps layout clean on smaller viewports */
}

/* Left text content */
.hero-text {
  flex: 1 1 480px;
  min-width: 300px;
}

.hero-text h2 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text-dark);
  margin-bottom: 1rem;
  line-height: 1.3;
}

.hero-text .highlight {
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--color-text-light);
  max-width: 540px;
  margin-bottom: 1.5rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.hero-points {
  list-style: none;
  color: var(--color-text-dark);
}
.hero-points li {
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

/* Right visual area */
.hero-visual {
  flex: 0 0 320px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Chart bars reused from animation */
.hero-card .bar {
  width: 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
  animation-delay: calc(var(--i, 0) * 0.25s);
}

/* Add a soft radial shadow glow */
.hero-card::before {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 10px;
  background: radial-gradient(circle, rgba(22, 163, 74, 0.2) 0%, transparent 80%);
  filter: blur(6px);
  border-radius: 50%;
}

/* Responsive fix for smaller screens */
@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 2.5rem 1.5rem;
  }
  .hero-text {
    flex: 1 1 auto;
    align-items: center;
  }
  .hero-buttons {
    justify-content: center;
  }
  .hero-visual {
    flex: 1 1 auto;
    margin-top: 2rem;
  }
}

/* ============================================================
   💹 BALANCR HERO GRAPH ENHANCEMENT
   Adds animated “cool” graph visualization with floating glow.
   ============================================================ */

/* Chart container refinements */
.hero-visual {
  flex: 0 0 320px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-card {
  position: relative;
  background: #fff;
  border-radius: 18px;
  padding: 2rem 2.5rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;

  animation: floatPulse 4s ease-in-out infinite;
  transform-origin: center;
}

/* Animated bars */
.hero-card .bar {
  width: 16px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
  animation: barGrow 1.8s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.25s);
}

.hero-card .bar1 {
  height: 30px;
  --i: 0;
}
.hero-card .bar2 {
  height: 50px;
  --i: 1;
}
.hero-card .bar3 {
  height: 75px;
  --i: 2;
}
.hero-card .bar4 {
  height: 45px;
  --i: 3;
}

@keyframes barGrow {
  0%,
  100% {
    transform: scaleY(1);
    opacity: 0.9;
  }
  50% {
    transform: scaleY(1.3);
    opacity: 1;
  }
}

/* Soft floating motion */
@keyframes floatPulse {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  }
  50% {
    transform: translateY(-6px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);
  }
}

/* Glow pulse beneath the chart */
.hero-card .pulse {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-accent) 25%, transparent 70%);
  filter: blur(6px);
  opacity: 0.6;
  animation: glowPulse 3.5s ease-in-out infinite;
}

@keyframes glowPulse {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.15);
  }
}

/* Scroll trigger integration */
.hero-visual,
.hero-visual .hero-card,
.hero-card .bar,
.hero-card .pulse {
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.8s ease-out;
}

.hero-visual.animate-in,
.hero-visual.animate-in .hero-card,
.hero-visual.animate-in .bar,
.hero-visual.animate-in .pulse {
  opacity: 1;
  transform: translateY(0);
}

.hero-visual.animate-in .hero-card {
  animation: floatPulse 4s ease-in-out infinite;
}
.hero-visual.animate-in .bar {
  animation: barGrow 1.8s ease-in-out infinite;
}
.hero-visual.animate-in .pulse {
  animation: glowPulse 3.5s ease-in-out infinite;
}

/* Mobile alignment */
@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.5rem 1.5rem;
  }
  .hero-visual {
    margin-top: 2rem;
  }
}

/* ============================================================
   🧭 BALANCR DASHBOARD LAYOUT FIX (Logged-In View)
   Restores full-width header and responsive card scaling.
   ============================================================ */

#app-container {
  width: 100%;
  min-height: 100vh;
  background: var(--color-bg);
}

/* --- FULL-WIDTH HEADER --- */
#app-container header {
  width: 100%;
  max-width: none;
  border-radius: 0;
  margin: 0;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* --- MAIN AREA --- */
#app-container main {
  width: 100%;
  max-width: 1280px; /* slightly wider than before */
  margin: 2rem auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* --- SECTION BLOCKS --- */
#app-container section {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s ease;
}
#app-container section:hover {
  transform: translateY(-3px);
}

/* --- CARDS INSIDE SECTIONS --- */
.budget-header,
.stat-card,
.category-card,
.transaction-item {
  width: 100%;
  max-width: none;
  margin: 0;
}

/* --- RESPONSIVE IMPROVEMENT --- */
@media (min-width: 1200px) {
  #app-container main {
    max-width: 1440px;
    padding: 0 3rem;
  }
}

@media (max-width: 768px) {
  #app-container main {
    padding: 1rem;
    margin: 1rem 0;
  }
  #app-container section {
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  }
}

.cards-container {
  display: flex;
  width: 100%;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* --- Base Card --- */
.category-card {
  background: linear-gradient(135deg, #ffffff 0%, #f9fafc 100%);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.3s ease;
  min-width: 200px;
  display: flex;
  flex-direction: column-reverse;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  background: linear-gradient(135deg, #fefefe 0%, #f5f7fb 100%);
}

/* --- Typography --- */
.category-card h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #2b2b2b;
}

.category-card .amount {
  font-size: 1.8rem;
  font-weight: 700;
  color: red;
  margin-top: 0.25rem;
}

/* --- Date Badge --- */
.category-card .badge {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  background: red;
  color: #fff;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 600;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
  transition: background 0.3s ease;
}
.category-card:hover .badge {
  background: #0056b3;
}

/* --- Subcards (children) --- */
.subcards {
  margin-left: 1rem;
  margin-top: 0.5rem;
  display: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.subcards.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.subcards .category-card {
  background: #fdfdfd;
  border: 1px solid #ececec;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04);
  font-size: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  min-width: 200px;
}

#daily-results {
  display: flex;
  padding: 1rem;
  align-items: center;
}

#daily-results .category-card {
  width: 16%;
  margin: 0 1rem;
  text-align: center;
}
#expenses-table-body button {
  color: gray;
  background: transparent;
  font-size: xx-large;
}

#transactions-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

  background: linear-gradient(135deg, #ffffff 0%, #f9fafc 100%);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  padding: 1.25rem 1.5rem;

  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.3s ease;
  min-width: 200px;
}
.type-expense {
  border: solid 1px red;
}
.type-income {
  border: solid 1px green;
}

.delete-btn:hover {
  background: #c82333;
}

textarea {
  font-family: 'Courier New', monospace;
  resize: vertical;
}

.category-form {
  background: #f5f5f5;
  padding: 20px;
  border-radius: 8px;
  background: #f5f5f5;
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.category-form h4 {
  margin-bottom: 15px;
  color: #667eea;
}

.categories-tree {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  max-height: 300px;
  overflow-y: auto;
}

.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  margin: 5px 0;
  background: #f9f9f9;
  border-radius: 6px;
  border-left: 3px solid #667eea;
}

/* Styles for auto-generated categories to visually distinguish them */
.category-item .auto-category {
  background: #fbfbfd;
  border-left-color: #95a5a6; /* muted left bar */
  color: #444;
  opacity: 0.95;
}

/* small badge indicating auto-generated */
.category-item .auto-category .auto-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  background: #95a5a6;
  color: white;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

.category-info {
  flex: 1;
}

.category-info strong {
  color: #333;
  font-size: 16px;
}

/* lighter allocation chip for auto categories */
.category-allocation {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 8px;
  background: #667eea;
  color: white;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

.category-allocation.auto {
  background: #95a5a6;
}

/* slightly muted description for auto categories */
.category-description {
  margin-top: 5px;
  font-size: 13px;
  color: #666;
  font-style: italic;
}

.category-description.auto {
  color: #7a8a8a;
  font-style: italic;
}

/* Inline info message styling to call out important messages */
.message.info {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  padding: 8px 12px;
  border-radius: 6px;
  margin: 10px 0;
  font-size: 13px;
}

.remove-category-btn {
  background: #e74c3c;
  padding: 6px 12px;
  font-size: 14px;
}

.remove-category-btn:hover {
  background: #c0392b;
}

#add-category-btn {
  background: #27ae60;
}

#add-category-btn:hover {
  background: #229954;
}
.income-expense-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  row-gap: 1rem;
  margin-bottom: 1rem;
}

/* Budget Chart Styles */
#budget-graph {
  margin: 20px 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#budget-graph h3 {
  margin: 0 0 15px 0;
  color: #2c3e50;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

#budget-pie-chart {
  max-width: 300px;
  max-height: 300px;
  margin: 0 auto;
  display: block;
}

#budget-legend {
  margin-top: 15px;
  padding: 10px;
  background: white;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}
