/* css/components.css - FINAL CLEANED VERSION */

/* =========================================
   1. LAYOUT PANELS
   ========================================= */

   /* --- Category Add Container (Wrapper for 'Create New' button) --- */
   .category-add-container {
     padding: 0 1.5rem 1.5rem; /* Matches padding of .category-list */
     width: 100%;
   }

/* Category Panel (Left Side) */
.category-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px var(--shadow);
  transition: background-color 0.3s, border-color 0.3s;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  position: relative;
}

.category-panel:hover { border-color: var(--accent); }

.category-form-title {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 1.5rem 1.5rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.category-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-list::-webkit-scrollbar { display: none; }

.category-add-btn {
  width: calc(100% - 3rem);
  margin: 0 auto 1.5rem auto;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(139, 92, 237, 0.3);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  z-index: 10;
}

.category-add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 247, 0.5);
}

.category-add-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 10px rgba(139, 92, 247, 0.3);
}

/* Command Center (Right Panel) */
.command-center-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px var(--shadow);
  transition: background-color 0.3s, border-color 0.3s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.command-center-card:hover { border-color: var(--accent); }

.command-tabs {
  display: flex;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem;
  gap: 0.5rem;
}

.cmd-tab {
  flex: 1;
  padding: 0.6rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.cmd-tab:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.cmd-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139, 92, 237, 0.3);
}

.cmd-view {
  display: none;
  padding: 1.5rem;
  flex: 1;
  animation: fadeIn 0.3s ease;
}

.cmd-view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   2. FORMS & INPUTS
   ========================================= */

/* Main Form Panel */
.form-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px var(--shadow);
  transition: background-color 0.3s, border-color 0.3s;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-panel:hover { border-color: var(--accent); }

/* Form Groups */
.add-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.add-form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

/* Standard Inputs */
.category-search-input,
.payment-method-select,
input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.category-search-input:focus,
.payment-method-select:focus,
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 237, 0.1);
}

/* Error States */
input.error, select.error {
  border-color: var(--red);
  background: rgba(239, 68, 68, 0.05);
}

.error-message {
  color: var(--red);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: none;
  font-weight: 600;
}

.error-message.show { display: block; }

/* Type Toggle Buttons */
.type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.type-btn {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.type-btn.active-income {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green);
}

.type-btn.active-expense {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
}

/* =========================================
   TAG PILLS - COMPACT & SINGLE LINE
   ========================================= */

/* Target the tag selector specifically inside the Add Form */
.form-panel .tag-selector,
.category-panel .tag-selector,
.command-center-card .tag-selector {
  display: flex;
  flex-wrap: nowrap; /* Forces single line */
  gap: 0.4rem;       /* Slightly tighter gap */
  overflow-x: auto;  /* Enables horizontal scroll on small screens */
  padding-bottom: 0.2rem;
  margin-bottom: 0.5rem;
  scrollbar-width: thin; /* Firefox */
  -webkit-overflow-scrolling: touch; /* iOS Smooth Scroll */
}

/* Hide scrollbar visually but keep functionality (Chrome/Safari/Edge) */
.form-panel .tag-selector::-webkit-scrollbar,
.category-panel .tag-selector::-webkit-scrollbar,
.command-center-card .tag-selector::-webkit-scrollbar {
  height: 4px;
}

.form-panel .tag-selector::-webkit-scrollbar-thumb,
.category-panel .tag-selector::-webkit-scrollbar-thumb,
.command-center-card .tag-selector::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.form-panel .tag-selector::-webkit-scrollbar-track,
.category-panel .tag-selector::-webkit-scrollbar-track,
.command-center-card .tag-selector::-webkit-scrollbar-track {
  background: transparent;
}

/* Individual Tag Pills - COMPACT SIZE */
.tag-pill {
  padding: 0.25rem 0.5rem; /* Reduced padding significantly */
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;     /* Slightly tighter radius for small buttons */
  color: var(--text-dim);
  font-size: 0.75rem;      /* Smaller font */
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  min-width: fit-content;  /* Prevents squishing */
}

.tag-pill:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--surface-hover);
}

.tag-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* Submit Button (Below Tags) */
.submit-btn {
  width: 100%;
  padding: 0.85rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
  box-shadow: 0 4px 12px rgba(139, 92, 237, 0.3);
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(139, 92, 237, 0.4);
  opacity: 0.95;
}

.submit-btn:active {
  transform: translateY(0);
}

/* =========================================
   3. SPECIALIZED COMPONENTS
   ========================================= */

/* Amount Wrapper (Badge + Input) */
.amount-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-badge {
  position: absolute;
  left: 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  pointer-events: none;
  z-index: 2;
}

.amount-wrapper input {
  padding-left: 2rem;
}

/* Compact Numpad */
.compact-numpad {
  display: none; /* Toggled via JS inline style */
  margin-top: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.numpad-btn {
  padding: 0.8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.numpad-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.numpad-btn:active {
  transform: scale(0.95);
}

.numpad-del {
  color: var(--red);
}

/* Date Picker Trigger */
.date-picker-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.2s;
}

.date-picker-trigger:hover {
  border-color: var(--accent);
}

.date-display-text {
  font-weight: 500;
}

.date-icon-wrapper {
  color: var(--text-dim);
}

/* Notes Toggle */
.notes-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s ease;
  user-select: none;
  width: 100%;
}

.notes-toggle-row:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.notes-toggle-row[aria-expanded="true"] {
  border-color: var(--accent);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: 1px solid transparent;
  background: var(--surface-hover);
}

.notes-toggle-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.notes-status-text {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-left: 0.25rem;
}

.notes-toggle-icon {
  font-size: 0.75rem;
  color: var(--text-dim);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notes-toggle-row[aria-expanded="true"] .notes-toggle-icon {
  transform: rotate(180deg);
}

/* --- NOTES CONTAINER (Smooth Expand) --- */

.notes-container {
  display: none;
  border: 1px solid var(--accent);
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  animation: notesExpand 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.notes-container.open {
  display: block;
}

@keyframes notesExpand {
  from {
    opacity: 0;
    max-height: 0;
    padding: 0 0.75rem;
  }
  to {
    opacity: 1;
    max-height: 200px;
    padding: 0.75rem;
  }
}

/* --- NOTES TEXTAREA (Matches Input Fields) --- */

.notes-textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-family);
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  line-height: 1.5;
}

.notes-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 237, 0.1);
}

.notes-textarea::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}

/* --- CHARACTER COUNT (Polished Badge) --- */

.notes-char-count {
  text-align: right;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-top: 0.4rem;
  padding: 0.15rem 0.5rem;
  background: var(--surface-hover);
  border-radius: 4px;
  display: inline-block;
  float: right;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.notes-char-count.warning {
  color: var(--yellow);
  background: var(--yellow-bg);
}

.notes-char-count.danger {
  color: var(--red);
  background: var(--red-bg);
}

/* =========================================
   4. CUSTOM CATEGORY DROPDOWN
   ========================================= */

/* Hide Native Select */
#txCategory {
  display: none !important;
}

/* Wrapper */
.category-dropdown-wrapper {
  position: relative;
  width: 100%;
}

/* Search Input */
.category-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  cursor: text;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.category-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 237, 0.1);
}

.category-search-input.has-selection {
  font-weight: 600;
  color: var(--text);
}

/* Dropdown Panel */
.category-dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  display: none;
  margin-top: 4px;
  max-height: 250px;
  overflow-y: auto;
}

.category-dropdown-panel.open {
  display: block;
}

.cat-filter-row {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-hover);
  border-radius: 8px 8px 0 0;
}

.cat-filter-input {
  width: 100%;
  padding: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}

.cat-filter-input:focus {
  border-color: var(--accent);
}

#catOptionsList {
  padding: 0.25rem;
}

.cat-option {
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
  transition: background 0.1s;
  display: flex;
  align-items: center;
}

.cat-option:hover {
  background: var(--surface-hover);
}

.cat-option.selected {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.cat-option.focused {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.cat-option.no-match {
  color: var(--text-dim);
  font-style: italic;
  cursor: default;
  padding: 0.8rem;
}

/* =========================================
   5. CALENDAR POPUP
   ========================================= */

   .calendar-popup {
     position: absolute;
     background: var(--surface);
     border: 1px solid var(--border);
     border-radius: 16px; /* More rounded, modern look */
     box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.05);
     z-index: 2000;
     width: 300px; /* Slightly wider for better spacing */
     padding: 1.25rem;
     display: none;
     font-family: var(--font-family);
     backdrop-filter: blur(12px); /* Glass effect if behind content */
     -webkit-backdrop-filter: blur(12px);
     animation: calendarSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
   }

   @keyframes calendarSlideUp {
     from { opacity: 0; transform: translateY(10px) scale(0.98); }
     to { opacity: 1; transform: translateY(0) scale(1); }
   }

   .calendar-popup.active {
     display: block;
   }

   /* Header: Month & Year */
   .cal-header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     margin-bottom: 1.25rem;
     padding-bottom: 0.75rem;
     border-bottom: 1px solid var(--border);
   }

   .cal-month-year {
     font-weight: 700;
     font-size: 1.1rem;
     color: var(--text);
     letter-spacing: -0.02em;
   }

   /* Navigation Arrows */
   .cal-nav-btn {
     background: transparent;
     border: none;
     color: var(--text-dim);
     font-size: 1.4rem;
     cursor: pointer;
     padding: 0.25rem 0.5rem;
     border-radius: 8px;
     transition: all 0.2s ease;
     line-height: 1;
     display: flex;
     align-items: center;
     justify-content: center;
     width: 32px;
     height: 32px;
   }

   .cal-nav-btn:hover {
     background: var(--surface-hover);
     color: var(--text);
     transform: scale(1.1);
   }

   .cal-nav-btn:active {
     transform: scale(0.95);
   }

   /* Weekday Labels */
   .cal-weekdays {
     display: grid;
     grid-template-columns: repeat(7, 1fr);
     text-align: center;
     font-size: 0.75rem;
     font-weight: 600;
     color: var(--text-dim);
     margin-bottom: 0.5rem;
     text-transform: uppercase;
     letter-spacing: 0.05em;
   }

   /* Day Grid */
   .cal-days {
     display: grid;
     grid-template-columns: repeat(7, 1fr);
     gap: 4px; /* Tighter gap for a cohesive grid */
   }

   /* Individual Day Cell */
   .cal-day {
     aspect-ratio: 1;
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 0.9rem;
     font-weight: 500;
     color: var(--text);
     cursor: pointer;
     border-radius: 10px; /* Modern rounded corners */
     transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
     user-select: none;
     position: relative;
   }

   /* Hover State (Non-selected, Non-today) */
   .cal-day:hover:not(.cal-day-empty):not(.today):not(.selected) {
     background: var(--surface-hover);
     color: var(--accent);
     transform: scale(1.05);
   }

   /* Today Indicator */
   .cal-day.today {
     background: var(--accent);
     color: #fff;
     font-weight: 700;
     box-shadow: 0 4px 12px rgba(139, 92, 237, 0.4);
     transform: scale(1.05);
   }

   /* Selected Date */
   .cal-day.selected {
     background: var(--text);
     color: var(--bg);
     font-weight: 700;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
   }

   /* Empty Cells */
   .cal-day-empty {
     cursor: default;
     pointer-events: none;
   }

   /* Focus State for Accessibility */
   .cal-day:focus {
     outline: 2px solid var(--accent);
     outline-offset: 2px;
     z-index: 10;
   }

   /* "Jump to Today" Button */
   .cal-today-btn {
     width: 100%;
     margin-top: 1.25rem;
     padding: 0.6rem;
     background: transparent;
     border: 1px solid var(--border);
     border-radius: 10px;
     color: var(--text-dim);
     font-size: 0.85rem;
     font-weight: 600;
     cursor: pointer;
     transition: all 0.2s ease;
     text-transform: uppercase;
     letter-spacing: 0.05em;
   }

   .cal-today-btn:hover {
     background: var(--surface-hover);
     color: var(--text);
     border-color: var(--accent);
     transform: translateY(-1px);
   }

   .cal-today-btn:active {
     transform: translateY(0);
   }

/* =========================================
   6. TRANSACTION LIST & UTILS
   ========================================= */

.recent-tx-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}

.transaction-item:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.tx-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.tx-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: 50%;
}

.tx-details {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.tx-description {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.tx-amount {
  font-weight: 700;
  font-size: 1rem;
  margin-right: 0.5rem;
}

.tx-amount.income { color: var(--green); }
.tx-amount.expense { color: var(--red); }

.tx-delete {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  transition: all 0.2s;
  opacity: 0;
}

.transaction-item:hover .tx-delete {
  opacity: 1;
}

.tx-delete:hover {
  color: var(--red);
  background: var(--red-bg);
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
}

.empty-state .emoji {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* Quick Add Form (Inside Drilldown) */
.quick-add-form {
  background: var(--surface-hover);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

/* Danger Zone (Settings) */
.danger-zone {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px dashed var(--border);
}

/* --- TOOLTIP SYSTEM --- */
.bb-tooltip {
  position: fixed; /* Pulls it out of the document flow so it stops shifting your layout */
  z-index: 10000;  /* Ensures it floats above all other elements */
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  pointer-events: none; /* Prevents the tooltip from interfering with clicks */
  opacity: 0;
  box-shadow: 0 4px 12px var(--shadow);
  transition: opacity 0.2s ease;
}

.bb-tooltip.visible {
  opacity: 1;
}

/* Optional: Adds a small directional arrow depending on your JS logic */
.bb-tooltip::after {
  content: '';
  position: absolute;
  border-width: 5px;
  border-style: solid;
}

/* Default downward arrow (Tooltip above element) */
.bb-tooltip:not(.tip-up)::after {
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-color: var(--surface) transparent transparent transparent;
}

/* Upward arrow (Tooltip below element) */
.bb-tooltip.tip-up::after {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-color: transparent transparent var(--surface) transparent;
}

/* Floating Save/Cancel Popup (Toast Area) */
.floating-confirm-bar {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(150px);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 90%;
  max-width: 320px;
  text-align: center;
}

.floating-confirm-bar.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.quick-add-confirm-text {
  font-size: 1.1rem;
  color: var(--text);
}

.quick-add-confirm-text strong {
  color: var(--accent);
  font-weight: 700;
  display: block;
  font-size: 1.3rem;
  margin-top: 0.25rem;
}

.quick-add-confirm-actions {
  display: flex;
  gap: 0.75rem;
}

.quick-add-confirm-actions button {
  flex: 1;
  padding: 0.6rem;
  font-size: 0.9rem;
}

/* =========================================
   INCOME TAB POLISH
   ========================================= */

/* Add this new container class for the horizontal scrolling */
.income-quick-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.income-quick-scroll::-webkit-scrollbar {
  height: 4px;
}

.income-quick-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* Update your existing .income-quick-btn */
.income-quick-btn {
  flex-shrink: 0;             /* Prevents the buttons from squishing */
  white-space: nowrap;        /* Keeps the text on a single line */
  padding: 0.5rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;        /* Changed to pill shape to match your tags */
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.income-quick-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--surface-hover);
}

/* =========================================
   SAVINGS TAB FIXED BOTTOM
   ========================================= */

/* Ensure the main panel takes full height */
#view-savings .income-overview-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 400px;
}

/* Update your existing grid to take available space and scroll */
.savings-buckets-grid {
  padding: 0 1.5rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  flex: 1;                    /* Allows grid to push the deposit box down */
  overflow-y: auto;           /* Keeps the grid scrollable */
}

/* Update the quick add box to anchor to the bottom */
.savings-quick-add {
  margin-top: auto;           /* Forces it to the bottom of the flex container */
  background: var(--surface-hover);
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 0 0 12px 12px; /* Matches the parent panel's corners */
}

/*
* BudgetBuddy - components.css
* Handles: Layout, Forms, Dropdowns, Calendar
* Last Updated: 2026-06-05
*/
