/* ============================================
   Budget Analyser - Billie
   Enhanced Version
   ============================================ */

/* Hero Section */
.analyser-hero {
  background: linear-gradient(135deg, var(--background) 0%, rgba(204, 229, 253, 0.3) 100%);
  padding: 6rem 0 3rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(204, 229, 253, 0.5);
  color: var(--secondary);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.hero-badge svg {
  flex-shrink: 0;
}

.analyser-hero h1 {
  font-size: 3.5rem;
  color: var(--foreground);
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--muted-foreground);
  max-width: 600px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .analyser-hero {
    padding: 5rem 0 2rem;
  }
  
  .analyser-hero h1 {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .hero-badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }
}

/* Steps Indicator */
.steps-indicator {
  padding: 2rem 0;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 500px;
  margin: 0 auto;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.step.active {
  opacity: 1;
}

.step.completed {
  opacity: 1;
}

.step.completed .step-number {
  background: var(--secondary);
  color: white;
}

.step-number {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--foreground);
  transition: all 0.3s ease;
}

.step.active .step-number {
  background: var(--primary);
  color: white;
}

.step span {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.step.active span {
  color: var(--foreground);
  font-weight: 500;
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  max-width: 80px;
  margin: 0 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
  .step span {
    font-size: 0.75rem;
  }
  
  .step-number {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }
  
  .step-line {
    max-width: 40px;
    margin: 0 0.5rem;
  }
}

/* Analyser Sections */
.analyser-section {
  padding: 3rem 0;
  min-height: 400px;
}

/* Upload Section */
.upload-container {
  max-width: 700px;
  margin: 0 auto;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 1rem;
  padding: 3rem 2rem;
  text-align: center;
  background: var(--card);
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(35, 148, 0, 0.05);
}

.upload-icon {
  color: var(--primary);
  margin-bottom: 1rem;
}

.upload-zone h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.upload-zone p {
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}

.upload-hint {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  opacity: 0.7;
}

.upload-info {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-card {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(204, 229, 253, 0.3);
  border-radius: 0.75rem;
  border-left: 4px solid var(--secondary);
}

.info-card svg {
  flex-shrink: 0;
  color: var(--secondary);
}

.info-card h4 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.info-card p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

/* Privacy Info Card */
.privacy-info-card {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(34, 197, 94, 0.05);
  border-radius: 0.75rem;
  border-left: 4px solid #22c55e;
}

.privacy-icon {
  flex-shrink: 0;
  color: #22c55e;
}

.privacy-info-card h4 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #16a34a;
}

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

.privacy-checklist li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.privacy-checklist li svg {
  color: #22c55e;
  flex-shrink: 0;
}

/* Column Mapping Section */
.mapping-container {
  max-width: 900px;
  margin: 0 auto;
}

.mapping-container h2 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.mapping-subtitle {
  text-align: center;
  color: var(--muted-foreground);
  margin-bottom: 2rem;
}

.mapping-preview {
  background: var(--card);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

.mapping-preview h4 {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--muted-foreground);
}

.preview-table-wrapper {
  overflow-x: auto;
}

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

.preview-table th,
.preview-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.preview-table th {
  background: var(--muted);
  font-weight: 600;
}

.preview-table tr:last-child td {
  border-bottom: none;
}

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

.mapping-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.mapping-field select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--card);
  cursor: pointer;
}

.mapping-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(35, 148, 0, 0.15);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

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

.btn-primary:hover {
  background: #1a7000;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--muted);
  color: var(--foreground);
}

.btn-secondary:hover {
  background: #e5e4e2;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* Privacy Badge (Results Screen) */
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.privacy-badge svg {
  flex-shrink: 0;
}

/* Date Filter Bar */
.date-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.date-presets {
  display: flex;
  gap: 0.25rem;
}

.date-preset-btn {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.date-preset-btn:hover {
  background: var(--muted);
  color: var(--foreground);
}

.date-preset-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.date-range-display {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

@media (max-width: 640px) {
  .date-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .date-presets {
    justify-content: center;
  }
  
  .date-range-display {
    text-align: center;
  }
}

/* Results Section */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.summary-card {
  background: var(--card);
  border-radius: 0.75rem;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border);
}

.summary-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-icon.income {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.summary-icon.expense {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.summary-icon.net {
  background: rgba(204, 229, 253, 0.5);
  color: var(--secondary);
}

.summary-icon.transactions {
  background: rgba(35, 148, 0, 0.08);
  color: var(--primary);
}

.summary-content {
  display: flex;
  flex-direction: column;
}

.summary-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.summary-value {
  font-size: 1.5rem;
  font-family: var(--font-heading);
  color: var(--foreground);
}

/* Insights Summary */
.insights-summary {
  margin-bottom: 1.5rem;
}

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

.insight-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.insight-icon {
  font-size: 1.5rem;
}

.insight-content {
  display: flex;
  flex-direction: column;
}

.insight-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.insight-value {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--foreground);
}

/* Tabs */
.results-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.tab-btn:hover {
  color: var(--foreground);
}

.tab-btn.active {
  color: var(--primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.tab-content {
  background: var(--card);
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  min-height: 400px;
}

/* Vendors Tab */
.vendors-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.vendors-header h3 {
  font-size: 1.25rem;
}

.vendor-hint {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 1rem;
}

.vendors-filter input {
  padding: 0.625rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  width: 250px;
  font-family: var(--font-body);
}

.vendors-filter input:focus {
  outline: none;
  border-color: var(--primary);
}

.vendors-table-wrapper {
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
}

.results-table th,
.results-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.results-table th {
  font-weight: 600;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.results-table td {
  font-size: 0.9375rem;
}

.results-table tbody tr.vendor-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.results-table tbody tr.vendor-row:hover {
  background: rgba(35, 148, 0, 0.05);
}

.results-table .vendor-name {
  font-weight: 500;
}

.results-table .category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.results-table .amount {
  font-family: var(--font-heading);
  font-size: 1.125rem;
}

.results-table .amount.negative {
  color: #ef4444;
}

.results-table .amount.positive {
  color: #22c55e;
}

/* Sortable Table Headers */
.sortable-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.sortable-table th.sortable:hover {
  background: var(--muted);
}

.sortable-table th .sort-icon {
  display: inline-block;
  margin-left: 0.5rem;
  opacity: 0.3;
}

.sortable-table th .sort-icon::after {
  content: '↕';
}

.sortable-table th.sort-asc .sort-icon::after {
  content: '↑';
}

.sortable-table th.sort-desc .sort-icon::after {
  content: '↓';
}

.sortable-table th.sort-grouped .sort-icon::after {
  content: '⊞';
}

.sortable-table th.sort-asc .sort-icon,
.sortable-table th.sort-desc .sort-icon,
.sortable-table th.sort-grouped .sort-icon {
  opacity: 1;
  color: var(--primary);
}

/* Category Group Header */
.category-group-header td {
  background: var(--muted);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--primary);
}

.category-color-dot {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* Categories Tab */
.categories-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

#category-chart {
  width: 100% !important;
  max-width: 350px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }
}

.chart-container {
  position: relative;
  max-width: 400px;
  min-height: 300px;
  margin: 0 auto;
}

.chart-container canvas {
  max-width: 100%;
  height: auto !important;
}

.categories-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--muted);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.category-item:hover {
  background: rgba(35, 148, 0, 0.08);
  transform: translateX(4px);
}

.category-color {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

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

.category-name {
  font-weight: 500;
  font-size: 0.9375rem;
}

.category-count {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.category-amount {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  white-space: nowrap;
}

/* Other Breakdown */
.other-breakdown {
  margin-left: 1.5rem;
  padding: 1rem;
  background: rgba(203, 213, 225, 0.2);
  border-radius: 0.5rem;
  border-left: 3px solid #cbd5e1;
}

.other-breakdown-header {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted-foreground);
  margin-bottom: 0.75rem;
}

.other-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.other-breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  padding: 0.375rem 0;
  border-bottom: 1px dashed var(--border);
}

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

.other-vendor {
  color: var(--foreground);
}

.other-amount {
  font-family: var(--font-heading);
  color: var(--muted-foreground);
}

.other-hint {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-style: italic;
  margin-top: 0.75rem;
  margin-bottom: 0;
}

/* Timeline Tab */
.timeline-chart-container {
  position: relative;
  height: 400px;
}

/* Results Actions */
.results-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* Privacy Footer */
/* Erase Data Section */
.erase-data-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, rgba(204, 229, 253, 0.2) 0%, #fee2e2 100%);
  border: 2px dashed #fca5a5;
  border-radius: 1rem;
}

.btn-erase {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-erase:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

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

.erase-hint {
  font-size: 0.85rem;
  color: #b91c1c;
  font-weight: 500;
}

/* Privacy Footer */
.privacy-footer {
  margin-top: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #86efac;
  border-radius: 1rem;
}

.privacy-main {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.privacy-main svg {
  color: #22c55e;
  flex-shrink: 0;
  margin-top: 2px;
}

.privacy-main strong {
  display: block;
  color: #166534;
  margin-bottom: 0.25rem;
}

.privacy-main p {
  font-size: 0.875rem;
  color: #15803d;
  margin: 0;
}

.privacy-tip {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: white;
  border-radius: 0.5rem;
  border: 1px solid #bbf7d0;
}

.privacy-tip svg {
  color: #3b82f6;
  flex-shrink: 0;
  margin-top: 2px;
}

.privacy-tip span {
  font-size: 0.8rem;
  color: var(--foreground);
  line-height: 1.5;
}

.privacy-tip strong {
  color: #3b82f6;
}

/* CTA Section */
.analyser-cta {
  padding: 4rem 0;
  background: linear-gradient(135deg, var(--primary) 0%, #1a7000 100%);
  margin-top: 3rem;
}

.cta-content {
  text-align: center;
  color: white;
  max-width: 600px;
  margin: 0 auto;
}

.cta-content h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.cta-content p {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.cta-content .btn-primary {
  background: white;
  color: var(--primary);
}

.cta-content .btn-primary:hover {
  background: #f0f0f0;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--card);
  border-radius: 1rem;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.modal-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0;
  margin: -0.5rem;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--foreground);
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1.5rem;
  background: var(--muted);
}

.modal-stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-family: var(--font-heading);
  color: var(--foreground);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-chart-container {
  padding: 1.5rem;
  height: 250px;
}

.modal-chart-container h4 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.modal-chart-container canvas {
  height: 180px !important;
}

.modal-transactions {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
}

.modal-transactions h4 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.transaction-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.transaction-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--muted);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.transaction-item.highlighted {
  background: rgba(35, 148, 0, 0.15);
  box-shadow: 0 0 0 2px var(--primary);
}

.transaction-date {
  color: var(--muted-foreground);
  white-space: nowrap;
}

.transaction-desc {
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transaction-amount {
  font-family: var(--font-heading);
  color: #ef4444;
  white-space: nowrap;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--foreground);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.toast.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.toast svg {
  color: #22c55e;
}

/* Loading State */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--muted-foreground);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--muted);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--muted-foreground);
}

.empty-state svg {
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Responsive */
@media (max-width: 640px) {
  .summary-cards {
    grid-template-columns: 1fr 1fr;
  }
  
  .results-tabs {
    overflow-x: auto;
  }
  
  .tab-btn {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    white-space: nowrap;
  }
  
  .vendors-filter input {
    width: 100%;
  }
  
  .results-actions {
    flex-direction: column;
  }
  
  .results-actions .btn {
    width: 100%;
  }
  
  .cta-content h2 {
    font-size: 2rem;
  }
  
  .modal-stats {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .modal-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
  
  .transaction-item {
    grid-template-columns: 1fr auto;
  }
  
  .transaction-desc {
    grid-column: 1 / -1;
    order: 1;
  }
}

/* ============================================
   Expandable Transaction Rows
   ============================================ */

.transaction-hint {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-left: 0.5rem;
}

.transaction-item.expandable {
  display: block;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.transaction-item.expandable:hover {
  background: var(--muted);
}

.transaction-item.expandable.expanded {
  background: rgba(204, 229, 253, 0.2);
  border-left: 3px solid var(--primary);
}

.transaction-summary {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.875rem 1rem;
}

.expand-icon {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.transaction-details {
  padding: 0 1rem 1rem;
  animation: slideDown 0.2s ease;
}

.transaction-details.hidden {
  display: none;
}

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

.raw-transaction {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
}

.raw-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.raw-value {
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.85rem;
  color: var(--foreground);
  background: var(--muted);
  padding: 0.75rem;
  border-radius: 0.375rem;
  word-break: break-all;
  margin-bottom: 0.75rem;
}

.raw-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ============================================
   Category Detail View
   ============================================ */

.category-detail-view {
  animation: fadeIn 0.3s ease;
}

.categories-hint {
  font-size: 0.9rem;
  color: var(--muted-foreground);
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(204, 229, 253, 0.4);
  border-radius: 0.5rem;
  border-left: 3px solid var(--secondary);
}

.categories-list-wrapper {
  display: flex;
  flex-direction: column;
}

.category-detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.back-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--muted-foreground);
  transition: color 0.2s ease;
}

.back-btn:hover {
  color: var(--foreground);
}

.category-detail-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.category-detail-title h3 {
  font-size: 1.5rem;
  margin: 0;
}

.category-detail-total {
  font-size: 1.25rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.category-detail-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.category-vendors-chart {
  background: var(--card);
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.category-timeline {
  background: var(--card);
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.category-vendors-chart h4,
.category-timeline h4 {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: var(--foreground);
}

.category-timeline canvas {
  height: 200px !important;
  max-height: 200px;
}

.category-vendors-list {
  margin-top: 1rem;
  max-height: 300px;
  overflow-y: auto;
}

.category-vendor-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.category-vendor-item:hover {
  background: var(--muted);
}

.category-vendor-name {
  font-weight: 500;
}

.category-vendor-amount {
  color: #ef4444;
  font-weight: 600;
}

.category-month-list {
  margin-top: 1rem;
  max-height: 200px;
  overflow-y: auto;
}

.category-month-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid var(--border);
}

.category-month-item:hover {
  background: var(--muted);
}

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

.category-month-label {
  font-weight: 500;
}

.category-month-amount {
  color: #ef4444;
}

/* Month Drill-Down Modal */
.month-drilldown {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  animation: slideDown 0.2s ease;
}

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

.month-drilldown-header h5 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--foreground);
}

.month-drilldown-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted-foreground);
  padding: 0.25rem;
}

.month-vendors-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.month-vendor-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--muted);
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.month-vendor-row:hover {
  background: var(--border);
}

@media (max-width: 768px) {
  .category-detail-body {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   BIG BILLS STYLES
   ============================================ */

/* Layer Navigation */
.big-bills-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.layer-nav-btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.layer-nav-btn:hover {
  color: var(--foreground);
}

.layer-nav-btn.active {
  color: var(--primary);
}

.layer-nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.big-bills-layer {
  display: block;
}

.big-bills-layer.hidden {
  display: none;
}

/* Layer 0: Year Overview */
.year-overview-header {
  margin-bottom: 2rem;
}

.year-overview-header h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.bill-type-legend {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--muted);
  border-radius: 0.5rem;
  flex-wrap: wrap;
}

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

.legend-text {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

@media (max-width: 768px) {
  .bill-type-legend {
    flex-direction: column;
    gap: 0.75rem;
  }
}

.year-view-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.year-view-tab-btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.year-view-tab-btn:hover {
  color: var(--foreground);
}

.year-view-tab-btn.active {
  color: var(--primary);
}

.year-view-tab-btn.active {
  color: var(--primary);
  font-weight: 600;
}

.year-view-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.frequency-label {
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.year-summary {
  color: var(--muted-foreground);
  font-size: 0.9375rem;
}

.annual-heatmap-container {
  margin-bottom: 2rem;
}

.annual-heatmap-container h4 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.cash-flow-wave-container {
  margin-bottom: 2rem;
}

.cash-flow-wave-container h4 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.cash-flow-wave {
  background: var(--background);
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.wave-svg {
  display: block;
  width: 100%;
  height: auto;
}

.wave-point {
  transition: r 0.2s ease;
}

.wave-hit-area:hover + .wave-point,
.wave-point:hover {
  r: 8;
}

.wave-tooltip {
  transition: opacity 0.2s ease;
}

.annual-heatmap {
  background: var(--background);
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.5rem;
}

.heatmap-month {
  padding: 1rem 0.5rem;
  border-radius: 0.5rem;
  text-align: center;
  transition: all 0.2s ease;
}

.heatmap-month.clickable {
  cursor: pointer;
}

.heatmap-month.clickable:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.heatmap-month.selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.heatmap-month.forecasted-month {
  border: 2px dashed rgba(35, 148, 0, 0.3);
  position: relative;
}

.heatmap-forecast-indicator {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  opacity: 0.7;
}

.heatmap-month-label {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.heatmap-month-amount {
  font-size: 0.875rem;
  font-weight: 500;
}

/* Month Bills Display */
.month-bills-display {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.month-bills-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.month-bills-type {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

.month-bills-type.historical {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.month-bills-type.forecasted {
  background: rgba(204, 229, 253, 0.5);
  color: var(--primary);
}

.month-bills-header h5 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.month-bills-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted-foreground);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
}

.month-bills-close:hover {
  background: var(--background);
  color: var(--foreground);
}

.month-bills-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.month-bill-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--background);
  border-radius: 0.5rem;
  border: 1px solid var(--border);
}

.month-bill-color {
  width: 0.5rem;
  height: 2.5rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.month-bill-details {
  flex: 1;
  min-width: 0;
}

.month-bill-vendor {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.month-bill-meta {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.month-bill-amount {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary);
}

.month-bill-item.one-off-bill {
  opacity: 0.7;
  background: rgba(239, 68, 68, 0.05);
}

.one-off-badge {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.625rem;
  font-weight: 500;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  margin-left: 0.5rem;
}

.bill-type-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 0.5rem;
}

.bill-type-badge.automatic {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.bill-type-badge.predicted {
  background: rgba(251, 191, 36, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.bill-type-badge-small {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 0.5rem;
}

.bill-type-badge-small.automatic {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.bill-type-badge-small.predicted {
  background: rgba(251, 191, 36, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.toggle-one-off-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted-foreground);
  font-size: 1rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.toggle-one-off-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(204, 229, 253, 0.3);
}

/* Top 10 Recurring Bills */
.top-10-bills-section {
  margin-bottom: 2rem;
}

.top-10-bills-section h4 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.top-10-bills-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.top-10-bill-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.top-10-bill-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.top-10-bill-item.expanded {
  border-color: var(--primary);
  background: rgba(204, 229, 253, 0.15);
}

.top-10-bill-item.one-off-bill {
  opacity: 0.8;
}

.toggle-one-off-btn-small {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.toggle-one-off-btn-small:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(204, 229, 253, 0.3);
}

.top-10-bill-rank {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.875rem;
}

.top-10-bill-content {
  flex: 1;
  min-width: 0;
}

.top-10-bill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.top-10-bill-vendor {
  font-weight: 600;
  font-size: 1rem;
  color: var(--foreground);
}

.top-10-bill-amount {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
}

.top-10-bill-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.top-10-bill-category {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.top-10-bill-frequency {
  text-transform: capitalize;
}

.top-10-bill-date {
  color: var(--muted-foreground);
}

.top-10-bill-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.top-10-bill-details.hidden {
  display: none;
}

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

.bill-detail-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.bill-detail-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

.top-10-bill-expand {
  flex-shrink: 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  transition: transform 0.2s ease;
}

.top-10-bill-item.expanded .top-10-bill-expand {
  transform: rotate(180deg);
}

.empty-message {
  text-align: center;
  color: var(--muted-foreground);
  padding: 2rem;
}

/* Last Year Summary */
.last-year-summary {
  margin-bottom: 2rem;
}

.last-year-summary.hidden {
  display: none;
}

.year-summary-last-year {
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  margin-bottom: 2rem;
}

.last-year-bill-item {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.last-year-bill-item.marked-one-off {
  opacity: 0.7;
  background: rgba(239, 68, 68, 0.05);
}

.toggle-one-off-btn-last-year-summary {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted-foreground);
  font-size: 1rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.toggle-one-off-btn-last-year-summary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(204, 229, 253, 0.3);
}

/* Date Bills Display */
.date-bills-display {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  animation: popupFadeIn 0.2s ease-out;
}

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

.date-bills-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.date-bills-header h5 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
}

.date-bills-total {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: rgba(204, 229, 253, 0.5);
  color: var(--primary);
  margin-top: 0.25rem;
}

.date-bills-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted-foreground);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
}

.date-bills-close:hover {
  background: var(--background);
  color: var(--foreground);
}

.date-bills-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.date-bill-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--background);
  border-radius: 0.5rem;
  border: 1px solid var(--border);
}

.date-bill-item.one-off-bill {
  opacity: 0.7;
  background: rgba(239, 68, 68, 0.05);
}

.date-bill-color {
  width: 0.5rem;
  height: 2.5rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.date-bill-details {
  flex: 1;
  min-width: 0;
}

.date-bill-vendor {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.date-bill-meta {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.date-bill-amount {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary);
  margin-right: 1rem;
}

.toggle-one-off-btn-date {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted-foreground);
  font-size: 1rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.toggle-one-off-btn-date:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(204, 229, 253, 0.3);
}

.last-year-bill-main {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.last-year-bill-color {
  width: 0.5rem;
  height: 3rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.last-year-bill-info {
  flex: 1;
  min-width: 0;
}

.last-year-bill-vendor {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.last-year-bill-meta {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.last-year-bill-separator {
  color: var(--muted-foreground);
}

.last-year-bill-amount {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin-right: 1rem;
}

.toggle-one-off-btn-last-year {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 0.5rem;
  cursor: pointer;
  color: var(--muted-foreground);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.toggle-one-off-btn-last-year:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(204, 229, 253, 0.3);
}

.last-year-bill-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.last-year-bill-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background: var(--card);
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.one-off-indicator {
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.one-off-indicator.active {
  background: rgba(239, 68, 68, 0.2);
}

.current-year-view {
  display: block;
}

.current-year-view.hidden {
  display: none;
}

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

.inventory-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
}

.inventory-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.inventory-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--foreground);
}

.category-breakdown-section {
  margin-bottom: 2rem;
}

.category-breakdown-section h4 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.breakdown-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.breakdown-tab-btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.breakdown-tab-btn:hover {
  color: var(--foreground);
}

.breakdown-tab-btn.active {
  color: var(--primary);
}

.breakdown-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.breakdown-view {
  display: block;
}

.breakdown-view.hidden {
  display: none;
}

.category-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.category-breakdown-item {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--background);
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
}

.category-breakdown-item.expandable {
  cursor: pointer;
}

.category-breakdown-item.expandable:hover {
  border-color: var(--primary);
}

.category-breakdown-item.expanded {
  border-color: var(--primary);
  background: rgba(204, 229, 253, 0.15);
}

.category-breakdown-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.category-breakdown-expand {
  flex-shrink: 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  transition: transform 0.2s ease;
  margin-left: auto;
}

.category-breakdown-item.expanded .category-breakdown-expand {
  transform: rotate(180deg);
}

.category-breakdown-details {
  padding: 0 1rem 1rem 1rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  padding-top: 1rem;
}

.category-breakdown-details.hidden {
  display: none;
}

.breakdown-bill-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--card);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}

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

.breakdown-bill-vendor {
  font-weight: 500;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.breakdown-bill-meta {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.breakdown-bill-amount {
  font-weight: 600;
  color: var(--primary);
  font-size: 1rem;
}

/* Vendor Breakdown Styles */
.vendor-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.vendor-breakdown-item {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--background);
  transition: all 0.2s ease;
}

.vendor-breakdown-item.expandable {
  cursor: pointer;
}

.vendor-breakdown-item.expandable:hover {
  border-color: var(--primary);
}

.vendor-breakdown-item.expanded {
  border-color: var(--primary);
  background: rgba(204, 229, 253, 0.15);
}

.vendor-breakdown-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.vendor-breakdown-color {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.vendor-breakdown-label {
  flex: 1;
  font-weight: 500;
}

.vendor-breakdown-value {
  font-weight: 600;
  color: var(--primary);
}

.vendor-breakdown-expand {
  flex-shrink: 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  transition: transform 0.2s ease;
}

.vendor-breakdown-item.expanded .vendor-breakdown-expand {
  transform: rotate(180deg);
}

.vendor-breakdown-details {
  padding: 0 1rem 1rem 1rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  padding-top: 1rem;
}

.vendor-breakdown-details.hidden {
  display: none;
}

.category-breakdown-color {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.category-breakdown-label {
  flex: 1;
  font-weight: 500;
}

.category-breakdown-value {
  font-weight: 600;
  color: var(--primary);
}

.vendor-summary-section {
  margin-bottom: 2rem;
}

.vendor-summary-section h4 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

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

.vendor-summary-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--background);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.vendor-summary-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.vendor-summary-color {
  width: 0.5rem;
  height: 3rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.vendor-summary-details {
  flex: 1;
  min-width: 0;
}

.vendor-summary-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.vendor-summary-meta {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.vendor-summary-amount {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin-right: 1rem;
}

.vendor-summary-date {
  text-align: right;
  min-width: 120px;
}

.vendor-summary-date-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}

.vendor-summary-date-value {
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.vendor-summary-date-days {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.year-overview-actions {
  margin-top: 2rem;
  text-align: center;
}

/* Layer 1: 90-Day Awareness */
.day-header {
  margin-bottom: 2rem;
}

.day-header h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.btn-back {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.9375rem;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
  transition: opacity 0.2s ease;
}

.btn-back:hover {
  opacity: 0.7;
}

.weather-forecast-container {
  margin-bottom: 2rem;
}

.weather-forecast-container h4 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.weather-forecast-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.weather-forecast-item {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.2s ease;
}

.weather-forecast-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.weather-forecast-item.sunny {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #fbbf24;
}

.weather-forecast-item.cloudy {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  border-color: #818cf8;
}

.weather-forecast-item.rain {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #60a5fa;
}

.weather-forecast-item.storm {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-color: #f87171;
}

.weather-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.weather-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.weather-amount {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.weather-count {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

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

.summary-card-small {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.summary-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--foreground);
}

.summary-value-small {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.stress-meter {
  width: 100%;
  height: 0.5rem;
  background: var(--border);
  border-radius: 0.25rem;
  overflow: hidden;
  margin-top: 0.5rem;
}

.stress-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

.stress-bar.low {
  background: #10b981;
}

.stress-bar.medium {
  background: #f59e0b;
}

.stress-bar.high {
  background: #ef4444;
}

.day-view-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.view-tab-btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.view-tab-btn:hover {
  color: var(--foreground);
}

.view-tab-btn.active {
  color: var(--primary);
}

.view-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.day-view-content {
  display: block;
}

.day-view-content.hidden {
  display: none;
}

/* Calendar View */
.bills-calendar {
  background: var(--background);
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

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

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.calendar-day {
  min-height: 80px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
  transition: all 0.2s ease;
}

.calendar-day:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.calendar-day.today {
  background: rgba(204, 229, 253, 0.5);
  border-color: var(--primary);
}

.calendar-day.past {
  opacity: 0.5;
}

.calendar-day.has-bills {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}

.calendar-day.clickable {
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-day.clickable:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 10;
  position: relative;
}

.calendar-day.selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  z-index: 10;
  position: relative;
}

.calendar-day-number {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.calendar-day-bills {
  margin-top: 0.5rem;
}

.calendar-day-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #ef4444;
  margin-bottom: 0.125rem;
}

.calendar-day-amount {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Timeline View */
.timeline-container {
  background: var(--background);
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.timeline-river {
  position: relative;
  height: 200px;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.timeline-bill {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem 0.5rem 0 0;
  min-width: 100px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timeline-bill:hover {
  transform: translateX(-50%) translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.timeline-bill-amount {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.timeline-bill-label {
  font-size: 0.75rem;
  opacity: 0.9;
}

.timeline-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* List View */
.bills-list-table {
  width: 100%;
}

.category-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: white;
}

.confidence-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.confidence-badge.high {
  background: #10b981;
  color: white;
}

.confidence-badge.medium {
  background: #f59e0b;
  color: white;
}

.confidence-badge.low {
  background: #ef4444;
  color: white;
}

/* Layer 2: Action */
.action-header {
  margin-bottom: 2rem;
}

.action-header h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.action-header p {
  color: var(--muted-foreground);
}

.action-kanban {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kanban-column {
  background: var(--background);
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.kanban-column h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 200px;
}

.kanban-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.kanban-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.kanban-card-header {
  border-left: 4px solid;
  padding-left: 0.75rem;
  margin-bottom: 0.75rem;
}

.kanban-card-vendor {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.kanban-card-amount {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
}

.kanban-card-body {
  margin-bottom: 1rem;
}

.kanban-card-date {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}

.kanban-card-category {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.kanban-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-action {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  background: var(--background);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

/* Action Modal */
.action-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.action-modal.hidden {
  display: none;
}

.modal-content {
  background: var(--card);
  border-radius: 0.75rem;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted-foreground);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--background);
  color: var(--foreground);
}

.action-tool-section {
  margin-bottom: 1.5rem;
}

.action-tool-section h4 {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

.action-tool-section ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.action-tool-section li {
  margin-bottom: 0.5rem;
}

.savings-calculation {
  background: var(--background);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-top: 0.75rem;
}

.savings-calculation > div {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.savings-calculation > div:last-child {
  border-bottom: none;
}

.savings-progress-bar {
  width: 100%;
  height: 1.5rem;
  background: var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.savings-progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

.loan-comparison {
  background: var(--background);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-top: 0.75rem;
}

.loan-comparison > div {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.loan-comparison > div:last-child {
  border-bottom: none;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.empty-state p {
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.empty-state ul {
  text-align: left;
  max-width: 400px;
  margin: 1rem auto;
}

.empty-state li {
  margin-bottom: 0.5rem;
  color: var(--muted-foreground);
}

/* Responsive */
@media (max-width: 1024px) {
  .action-kanban {
    grid-template-columns: 1fr;
  }
  
  .heatmap-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .weather-forecast-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .big-bills-nav {
    flex-wrap: wrap;
  }
  
  .layer-nav-btn {
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
  }
  
  .inventory-summary {
    grid-template-columns: 1fr;
  }
  
  .vendor-summary-item {
    flex-wrap: wrap;
  }
  
  .vendor-summary-amount {
    width: 100%;
    margin-right: 0;
    margin-top: 0.5rem;
  }
  
  .vendor-summary-date {
    width: 100%;
    text-align: left;
    margin-top: 0.5rem;
  }
  
  .day-summary-cards {
    grid-template-columns: 1fr;
  }
  
  .calendar-day {
    min-height: 60px;
  }
  
  .timeline-river {
    height: 150px;
  }
}

/* ============================================
   PRE-SEND PREVIEW
   ============================================ */

.pre-send-preview {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.pre-send-preview.hidden {
  display: none;
}

.preview-card {
  background: var(--card-bg, #fff);
  border-radius: 1rem;
  padding: 2rem;
  max-width: 700px;
  width: 95%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.preview-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.preview-card > p {
  color: #64748b;
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.preview-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.preview-privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #f0fdf4;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  color: #166534;
  line-height: 1.5;
}

.preview-privacy-note svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: #16a34a;
}

/* ============================================
   INCOME BREAKDOWN
   ============================================ */

.income-breakdown {
  background: var(--card-bg, #fff);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border, #e2e8f0);
}

.income-breakdown h4 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.income-breakdown-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1rem;
}

.income-sub-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  min-width: 180px;
}

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

.income-sub-label {
  color: #64748b;
}

.income-sub-value {
  font-weight: 600;
  margin-left: auto;
}

#income-breakdown-chart {
  display: block;
  margin: 0 auto;
}
