/* CSS Variables for Professional Business Theme */
:root[data-theme="light"] {
  /* Beige/Brown Professional Palette */
  --bg-primary: #F5EFE7;
  --bg-secondary: #FFFFFF;
  --bg-gradient-start: #C9B8A3;
  --bg-gradient-end: #8B7355;
  --text-primary: #3E2723;
  --text-secondary: #5D4037;
  --text-muted: #8B7355;
  --border-color: #D7CCC8;
  --accent-primary: #8B7355;
  --accent-secondary: #C9B8A3;
  --accent-light: #F5EFE7;
  --shadow-sm: 0 2px 8px rgba(139, 115, 85, 0.15);
  --shadow-md: 0 4px 15px rgba(139, 115, 85, 0.2);
  --shadow-lg: 0 20px 60px rgba(139, 115, 85, 0.3);
  --card-bg: #FFFFFF;
  --input-bg: #FFFFFF;
  --input-border: #D7CCC8;
  --modal-overlay: rgba(62, 39, 35, 0.5);
  --success-color: #6BCF9E;
  --warning-color: #F4A460;
  --error-color: #D84315;
  --info-color: #A0826D;
}

:root[data-theme="dark"] {
  /* Dark Business Theme */
  --bg-primary: #2C2416;
  --bg-secondary: #3E342A;
  --bg-gradient-start: #3E342A;
  --bg-gradient-end: #2C2416;
  --text-primary: #F5EFE7;
  --text-secondary: #D7CCC8;
  --text-muted: #A89B8F;
  --border-color: #5D4E42;
  --accent-primary: #C9B8A3;
  --accent-secondary: #8B7355;
  --accent-light: #5D4E42;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
  --card-bg: #3E342A;
  --input-bg: #4A3F35;
  --input-border: #5D4E42;
  --modal-overlay: rgba(0, 0, 0, 0.8);
  --success-color: #6BCF9E;
  --warning-color: #F4A460;
  --error-color: #FF6F4F;
  --info-color: #C9B8A3;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  min-height: 100vh;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Auth Section */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: var(--card-bg);
  padding: 40px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.auth-card h1 {
  font-size: 2em;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}

.auth-card h2 {
  font-size: 1.5em;
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.auth-card input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1em;
  transition: border 0.3s;
}

.phone-input-group {
  display: flex;
  gap: 10px;
  margin: 10px 0;
}

.country-code-select {
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1em;
  background: white;
  cursor: pointer;
  min-width: 110px;
  transition: border 0.3s;
}

.country-code-select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.phone-input-group input {
  flex: 1;
  margin: 0;
}

.auth-card input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.auth-card button {
  width: 100%;
  margin: 10px 0;
}

/* Login Logo */
.login-logo {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  display: block;
  object-fit: contain;
}

/* Main App */
#appSection {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.app-header {
  background: white;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 15px;
}

.dashboard-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.header-content h1 {
  font-size: 1.8em;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

/* Summary Cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 15px;
}

.card-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-color);
  color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(139, 115, 85, 0.08);
  transition: all 0.3s ease;
}

.card-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 115, 85, 0.12);
}

.card-content h3 {
  font-size: 1.6em;
  color: var(--text-primary);
  margin-bottom: 5px;
  font-weight: 600;
}

.card-content p {
  color: var(--text-muted);
  font-size: 0.875em;
  font-weight: 500;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 25px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.card h2 {
  font-size: 1.4em;
  margin-bottom: 20px;
  color: #2d3748;
}

/* Add Expense Form */
.add-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.input-amount, .input-select, .input-note, .input-filter, .input-date {
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1em;
  transition: border 0.3s;
  background: white;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
}

.input-select {
  font-size: 1.1em;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a5568' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.input-select option {
  padding: 10px;
  font-size: 1em;
}

.currency-fields {
  display: flex;
  gap: 10px;
  grid-column: 1 / -1;
  justify-content: space-between;
}

.input-amount:focus, .input-select:focus, .input-note:focus, .input-filter:focus, .input-date:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Date input specific styling */
input[type="date"] {
  color: #2d3748 !important;
  color-scheme: light;
  -webkit-appearance: none;
  appearance: none;
  position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 1;
  cursor: pointer;
  filter: invert(0.5);
}

input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
  color: #2d3748;
}

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-clear-button {
  display: none;
}

.button-group {
  display: flex;
  gap: 10px;
  grid-column: 1 / -1;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-voice, .btn-icon, .btn-delete, .btn-edit {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px; /* Better touch target on mobile */
  -webkit-appearance: none;
  appearance: none;
  user-select: none;
  -webkit-user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  flex: 1;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #edf2f7;
  color: #4a5568;
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-voice {
  background: var(--accent-primary);
  color: white;
  flex: 1;
}

.btn-voice:active {
  transform: scale(0.98);
}

.btn-voice:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

.btn-sms {
  background: var(--accent-secondary);
  color: white;
  flex: 1;
  border: none;
  padding: 15px 25px;
  border-radius: 12px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-sms:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

.btn-sms:active {
  transform: scale(0.98);
}

.btn-icon {
  background: #edf2f7;
  color: #4a5568;
  padding: 12px;
  aspect-ratio: 1;
  min-height: 44px;
}

.btn-icon:active {
  transform: scale(0.95);
}

.btn-icon:hover {
  background: #e2e8f0;
}

.btn-edit {
  background: #4299e1;
  color: white;
  padding: 8px 16px;
  font-size: 0.9em;
  min-height: 40px;
}

.btn-edit:active {
  transform: scale(0.98);
}

.btn-edit:hover {
  background: #3182ce;
}

.btn-delete {
  background: #fc8181;
  color: white;
  padding: 8px 16px;
  font-size: 0.9em;
}

.btn-delete:hover {
  background: #f56565;
}

/* Filters */
.filters-card h2 {
  margin-bottom: 20px;
}

.filters-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  align-items: center;
}

.input-filter {
  width: 100%;
}

/* Charts */
.charts-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.chart-card {
  min-height: 400px;
}

.chart-card h2 {
  margin-bottom: 20px;
  text-align: center;
}

.chart-card canvas {
  max-height: 320px;
  margin: 0 auto;
  display: block;
}

/* Expenses List */
.expenses-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.expense-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.expense-item {
  background: #f7fafc;
  border-radius: 12px;
  padding: 20px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 15px;
  align-items: center;
  transition: transform 0.2s;
}

.expense-item:hover {
  transform: translateX(5px);
  background: #edf2f7;
}

.expense-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
}

.expense-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.expense-category {
  font-weight: 600;
  color: #2d3748;
  font-size: 1.1em;
}

.expense-subcategory {
  color: #718096;
  font-size: 0.9em;
}

.expense-note {
  color: #a0aec0;
  font-size: 0.85em;
}

.expense-location {
  color: var(--accent-primary);
  font-size: 0.85em;
  font-weight: 500;
}

.expense-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.75em;
  font-weight: 600;
  margin-left: 8px;
}

.expense-type.business {
  background: var(--accent-primary);
  color: white;
}

.expense-type.travel {
  background: var(--accent-primary);
  color: white;
}

.expense-business {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.75em;
  font-weight: 600;
  margin-left: 8px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
}

.expense-payment-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.75em;
  font-weight: 600;
  margin-left: 8px;
}

.expense-payment-status.paid {
  background: #d4edda;
  color: #155724;
}

.expense-payment-status.unpaid {
  background: #fff3cd;
  color: #856404;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.expense-date {
  color: #a0aec0;
  font-size: 0.85em;
}

.expense-amount {
  font-size: 1.4em;
  font-weight: 700;
  color: #2d3748;
  text-align: right;
  line-height: 1.2;
}

.expense-amount small {
  font-size: 0.6em;
  color: #a0aec0;
  display: block;
}

.expense-actions {
  display: flex;
  gap: 8px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: white;
  margin: 5% auto;
  padding: 30px;
  border-radius: 20px;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-content h2 {
  margin-bottom: 20px;
}

.modal-content input, .modal-content select {
  width: 100%;
  margin-bottom: 15px;
}

.close {
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #a0aec0;
}

.close:hover {
  color: #2d3748;
}

/* Responsive */
@media (max-width: 768px) {
  #appSection {
    padding: 10px;
  }
  
  .app-header {
    padding: 15px;
  }
  
  .header-content {
    flex-wrap: wrap;
  }
  
  .header-content h1 {
    font-size: 1.4em;
  }
  
  .header-actions {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .card {
    padding: 20px;
  }
  
  .add-form {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .button-group {
    display: flex;
    gap: 10px;
    width: 100%;
  }
  
  .filters-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .charts-container {
    grid-template-columns: 1fr;
  }
  
  .expense-item {
    grid-template-columns: auto 1fr;
    padding: 15px;
  }
  
  .expense-amount {
    font-size: 1.2em;
    text-align: right;
  }
  
  .expense-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    margin-top: 10px;
    gap: 10px;
  }
  
  .summary-cards {
    grid-template-columns: 1fr;
  }
  
  .expenses-header {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  
  .expenses-header button {
    width: 100%;
  }
  
  .btn-primary, .btn-secondary, .btn-voice {
    padding: 16px 20px;
    font-size: 1.05em;
    min-height: 48px;
    justify-content: center;
  }
  
  .btn-edit, .btn-delete {
    min-height: 44px;
    padding: 12px 16px;
  }
  
  .input-amount, .input-select, .input-note, .input-filter, .input-date {
    padding: 14px;
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 48px;
    -webkit-appearance: none;
    appearance: none;
  }
  
  .modal-content {
    margin: 5% auto;
    padding: 20px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .category-section {
    padding: 15px;
  }
  
  .category-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .category-actions {
    width: 100%;
    justify-content: stretch;
  }
  
  .category-actions button {
    flex: 1;
  }
}

/* Category Management Styles */
.category-section {
  margin-bottom: 30px;
  padding: 20px;
  background: #f7fafc;
  border-radius: 10px;
}

.category-section h3 {
  margin-bottom: 15px;
  color: #2d3748;
}

.input-color {
  width: 80px;
  height: 40px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
}

.categories-list {
  max-height: 400px;
  overflow-y: auto;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  background: white;
  border-radius: 10px;
  margin-bottom: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.category-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-icon {
  font-size: 2em;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.category-details h4 {
  margin: 0;
  color: #2d3748;
}

.category-details p {
  margin: 5px 0 0 0;
  font-size: 0.9em;
  color: #718096;
}

.subcategory-badge {
  display: inline-block;
  padding: 4px 8px;
  background: #e2e8f0;
  border-radius: 5px;
  font-size: 0.85em;
  margin-right: 5px;
  margin-top: 5px;
  position: relative;
}

.subcategory-delete-btn {
  background: none;
  border: none;
  color: #e53e3e;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 4px;
  font-size: 0.9em;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.subcategory-delete-btn:hover {
  opacity: 1;
  color: #c53030;
}

.category-actions {
  display: flex;
  gap: 10px;
}

.btn-delete {
  background: linear-gradient(135deg, #f56565 0%, #c53030 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.3s ease;
}

.btn-delete:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 101, 101, 0.4);
}

/* AI Insights Styles */
.insights-container {
  margin-bottom: 20px;
}

.insights-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border-radius: 12px;
  margin-bottom: 15px;
  color: white;
}

.insights-header span {
  font-weight: 600;
  font-size: 1.1em;
}

.btn-close-all {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-close-all:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.insight-card {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  padding: 15px 20px;
  border-radius: 15px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  animation: slideIn 0.3s ease;
}

.insight-card.warning {
  background: var(--accent-primary);
}

.insight-card.info {
  background: var(--accent-secondary);
}

.insight-icon {
  font-size: 2em;
  flex-shrink: 0;
}

.insight-content {
  flex: 1;
}

.insight-title {
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 1.1em;
}

.insight-description {
  opacity: 0.9;
  font-size: 0.9em;
}

.insight-close {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  font-size: 1.2em;
}

.insight-close:hover {
  opacity: 1;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Recurring Expenses Alert */
.recurring-alert {
  background: linear-gradient(135deg, #ffd166 0%, #f39c12 100%);
  color: #2d3748;
  border: none;
}

.recurring-item {
  background: white;
  padding: 12px;
  border-radius: 10px;
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recurring-info h4 {
  margin: 0 0 5px 0;
  color: #2d3748;
}

.recurring-info p {
  margin: 0;
  color: #718096;
  font-size: 0.9em;
}

.recurring-actions button {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;
}

.recurring-actions button:hover {
  background: #5568d3;
}

/* Analytics Section */
.analytics-card {
  margin-bottom: 20px;
}

.analytics-section {
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.analytics-section h3 {
  margin: 0 0 15px 0;
  color: #2d3748;
  font-size: 1.2em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.analytics-stat {
  background: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
}

.analytics-stat-label {
  font-size: 0.85em;
  color: #718096;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.analytics-stat-value {
  font-size: 1.8em;
  font-weight: bold;
  color: #2d3748;
}

.analytics-stat-subtext {
  font-size: 0.8em;
  color: #a0aec0;
  margin-top: 5px;
}

.top-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.top-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.top-item:hover {
  transform: translateX(5px);
}

.top-item-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.top-item-icon {
  font-size: 2em;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.top-item-details {
  display: flex;
  flex-direction: column;
}

.top-item-name {
  font-weight: bold;
  font-size: 1.1em;
  color: #2d3748;
}

.top-item-count {
  font-size: 0.85em;
  color: #718096;
}

.top-item-amount {
  font-size: 1.3em;
  font-weight: bold;
  color: var(--accent-primary);
}

.predictions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prediction-item {
  background: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-left: 4px solid var(--accent-primary);
}

.prediction-item.warning {
  border-left-color: #ffd166;
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

.prediction-item.alert {
  border-left-color: var(--accent-secondary);
  background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
}

.prediction-title {
  font-weight: bold;
  margin-bottom: 5px;
  color: #2d3748;
}

.prediction-text {
  font-size: 0.95em;
  color: #4a5568;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin Panel Styles */
.admin-panel {
  background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  border: 2px solid #ffd166;
  box-shadow: 0 4px 15px rgba(255, 209, 102, 0.3);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.admin-header h3 {
  font-size: 1.5em;
  color: #c53030;
  margin: 0;
}

.admin-invite-code {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f7fafc;
  padding: 10px 15px;
  border-radius: 10px;
  border: 2px solid var(--accent-primary);
}

.invite-code {
  font-family: 'Courier New', monospace;
  font-size: 1.2em;
  font-weight: bold;
  color: var(--accent-primary);
  letter-spacing: 2px;
}

.admin-controls {
  display: flex;
  gap: 10px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-primary);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.btn-link:hover {
  color: var(--accent-secondary);
}

.admin-btn {
  padding: 10px 20px;
  border: 2px solid var(--accent-primary);
  background: white;
  color: var(--accent-primary);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.admin-btn:hover {
  background: var(--accent-primary);
  color: white;
  transform: translateY(-2px);
}

.admin-btn.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.consolidated-stats {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.household-total {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  color: white;
}

.household-total h2 {
  font-size: 1.2em;
  margin-bottom: 10px;
  opacity: 0.9;
}

.big-amount {
  font-size: 3em;
  font-weight: bold;
  margin: 10px 0;
}

.stat-subtext {
  opacity: 0.8;
  font-size: 0.9em;
}

.user-breakdown h3 {
  font-size: 1.3em;
  margin-bottom: 15px;
  color: #2d3748;
}

.user-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border-left: 4px solid var(--accent-primary);
}

.user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.user-phone {
  font-weight: 600;
  color: #2d3748;
  font-size: 1.1em;
}

.user-total {
  font-size: 1.5em;
  font-weight: bold;
  color: var(--accent-primary);
}

.user-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
  color: #718096;
  font-size: 0.9em;
}

.user-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.cat-tag {
  background: #edf2f7;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  color: #4a5568;
}

.user-selector {
  padding: 20px;
}

.user-selector h3 {
  font-size: 1.3em;
  margin-bottom: 15px;
  color: #2d3748;
}

.user-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.user-select-btn {
  padding: 15px 20px;
  border: 2px solid #e2e8f0;
  background: white;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.3s;
  text-align: left;
}

.user-select-btn:hover {
  border-color: var(--accent-primary);
  background: #f7fafc;
  transform: translateY(-2px);
}

.user-select-btn.selected {
  border-color: var(--accent-primary);
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  font-weight: 600;
}

.selected-user-info {
  background: #e6fffa;
  padding: 15px;
  border-radius: 10px;
  border-left: 4px solid #38b2ac;
  margin-top: 15px;
}

.selected-user-info strong {
  color: #2c7a7b;
}

.hint {
  color: #a0aec0;
  font-style: italic;
  text-align: center;
  margin-top: 20px;
}

/* SMS Scanner Styles */
.sms-modal .modal-content {
  max-width: 600px;
}

.sms-hint {
  color: #718096;
  font-size: 0.9em;
  margin-bottom: 15px;
  line-height: 1.5;
}

.sms-input {
  width: 100%;
  padding: 15px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.95em;
  font-family: 'Courier New', monospace;
  resize: vertical;
  margin-bottom: 15px;
  background: #f7fafc;
}

.sms-input:focus {
  border-color: var(--accent-primary);
  outline: none;
  background: white;
}

.sms-result {
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #e6fffa 0%, #ffffff 100%);
  border-radius: 12px;
  border-left: 4px solid #38b2ac;
}

.sms-parsed h3 {
  color: #2c7a7b;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.parsed-field {
  padding: 10px;
  margin: 8px 0;
  background: white;
  border-radius: 8px;
  font-size: 0.95em;
}

.parsed-field strong {
  color: #2d3748;
  margin-right: 10px;
}

.sms-parsed .btn-primary {
  margin-top: 15px;
  width: 100%;
}

@media (max-width: 768px) {
  .admin-panel {
    padding: 15px;
    margin-left: -10px;
    margin-right: -10px;
    border-radius: 10px;
    overflow: hidden;
  }
  
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .admin-controls {
    width: 100%;
    flex-direction: column;
  }
  
  .admin-btn {
    flex: 1;
    width: 100%;
    padding: 12px;
    font-size: 0.95em;
  }
  
  .household-total {
    padding: 20px;
  }
  
  .big-amount {
    font-size: 2em;
  }
  
  .user-card {
    padding: 15px;
  }
  
  .user-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .user-total {
    font-size: 1.3em;
  }
  
  .user-stats {
    flex-direction: column;
    gap: 5px;
  }
  
  .user-list {
    grid-template-columns: 1fr;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .btn-voice, .btn-sms {
    width: 100%;
  }
  
  /* Fix two-column grid on mobile */
  .consolidated-stats > div[style*="grid"] {
    grid-template-columns: 1fr !important;
  }
}

/* SMS Auto-Capture Styles */
.sms-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
}

.sms-tab {
  padding: 12px 20px;
  border: none;
  background: none;
  color: #718096;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
}

.sms-tab:hover {
  color: #4a5568;
  background: #f7fafc;
}

.sms-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.sms-tab-content {
  display: none;
}

.sms-tab-content.active {
  display: block;
}

.merchant-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.merchant-input-group input {
  flex: 1;
}

.merchant-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.merchant-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: white;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid #e2e8f0;
}

.merchant-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #2d3748;
}

.btn-delete-small {
  background: #fee;
  border: none;
  color: #e53e3e;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-delete-small:hover {
  background: #e53e3e;
  color: white;
}

.auto-capture-toggle {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: linear-gradient(135deg, #e6fffa 0%, #ffffff 100%);
  border-radius: 12px;
  border-left: 4px solid #38b2ac;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e0;
  transition: .4s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #38b2ac;
}

input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

.toggle-label {
  flex: 1;
}

.toggle-label strong {
  display: block;
  color: #2c7a7b;
  margin-bottom: 5px;
}

.toggle-label p {
  margin: 0;
  color: #4a5568;
  font-size: 0.9em;
}

/* Receipt Scanner Styles */
.btn-receipt {
  background: linear-gradient(135deg, #38b2ac 0%, #2c7a7b 100%);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-receipt:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 178, 172, 0.4);
}

.receipt-modal {
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 2% auto;
}

.receipt-upload-area {
  min-height: 300px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.upload-prompt {
  text-align: center;
  padding: 40px 20px;
  border: 2px dashed #cbd5e0;
  border-radius: 15px;
  background: #f7fafc;
}

.upload-prompt p {
  color: #4a5568;
  margin: 0 0 20px 0;
  font-size: 1.1em;
}

.receipt-preview {
  position: relative;
  text-align: center;
  max-height: 50vh;
  overflow-y: auto;
}

.receipt-preview img {
  max-width: 100%;
  max-height: 45vh;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  margin-bottom: 15px;
  object-fit: contain;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9em;
}

.ocr-progress {
  text-align: center;
  padding: 40px 20px;
}

.spinner {
  border: 4px solid #e2e8f0;
  border-top: 4px solid var(--accent-primary);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.ocr-progress p {
  color: #4a5568;
  margin: 10px 0;
}

.ocr-status {
  color: var(--accent-primary);
  font-weight: 600;
}

.ocr-result {
  background: #f0fff4;
  padding: 25px;
  border-radius: 15px;
  border: 2px solid #9ae6b4;
}

.ocr-result h3 {
  color: #2f855a;
  margin-top: 0;
  margin-bottom: 20px;
}

.scanned-data {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
}

.data-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #38b2ac;
}

.data-label {
  font-weight: 600;
  color: #2c7a7b;
}

.data-value {
  font-size: 1.1em;
  color: #2d3748;
}

@media (max-width: 768px) {
  .receipt-modal {
    max-width: 95%;
    max-height: 85vh;
    margin: 5% auto;
  }
  
  .receipt-upload-area {
    min-height: 250px;
    max-height: 60vh;
  }
  
  .upload-prompt {
    padding: 30px 15px;
  }
  
  .upload-prompt i {
    font-size: 36px !important;
  }
}

/* Budget Management Styles */
.budget-section {
  margin-bottom: 30px;
}

.budget-section h3 {
  font-size: 1.2em;
  color: #2d3748;
  margin-bottom: 15px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 10px;
}

.budget-form {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 0.8fr auto;
  gap: 10px;
  align-items: center;
}

@media (max-width: 768px) {
  .budget-form {
    grid-template-columns: 1fr;
  }
}

.budget-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #f7fafc;
  border-radius: 10px;
  margin-bottom: 10px;
  border-left: 4px solid var(--accent-primary);
}

.budget-info {
  flex: 1;
}

.budget-category {
  font-size: 1.1em;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 5px;
}

.budget-details {
  display: flex;
  gap: 15px;
  font-size: 0.9em;
  color: #4a5568;
}

.budget-amount {
  font-weight: 600;
  color: var(--accent-primary);
}

.btn-danger {
  background: #f56565;
}

.btn-danger:hover {
  background: #c53030;
}

.budgets-list {
  max-height: 300px;
  overflow-y: auto;
}

/* Budget Progress Cards */
.budget-progress-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border-left: 5px solid #48bb78;
}

.budget-progress-card.budget-warning {
  border-left-color: #ed8936;
  background: #fffaf0;
}

.budget-progress-card.budget-exceeded {
  border-left-color: #f56565;
  background: #fff5f5;
}

.budget-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.budget-header-row h4 {
  margin: 0;
  color: #2d3748;
  font-size: 1.1em;
}

.budget-percentage {
  font-size: 1.3em;
  font-weight: bold;
  color: #48bb78;
}

.budget-warning .budget-percentage {
  color: #dd6b20;
}

.budget-exceeded .budget-percentage {
  color: #c53030;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 15px;
}

.progress-fill {
  height: 100%;
  transition: width 0.5s ease;
  background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
}

.progress-fill.budget-warning {
  background: linear-gradient(90deg, #ed8936 0%, #dd6b20 100%);
}

.progress-fill.budget-exceeded {
  background: linear-gradient(90deg, #f56565 0%, #c53030 100%);
}

.budget-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.budget-stat {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.85em;
  color: #718096;
  margin-bottom: 5px;
}

.stat-value {
  display: block;
  font-size: 1.2em;
  font-weight: 600;
  color: #2d3748;
}

.stat-value.spent {
  color: var(--accent-primary);
}

.stat-value.remaining {
  color: #48bb78;
}

.stat-value.exceeded {
  color: #c53030;
}

.budget-alert {
  margin-top: 15px;
  padding: 10px 15px;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
}

.budget-alert.warning {
  background: #feebc8;
  color: #7c2d12;
}

.budget-alert.exceeded {
  background: #fed7d7;
  color: #742a2a;
}

/* Budget Alert Banner */
.budget-banner {
  margin: 20px 0;
  padding: 15px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  animation: slideDown 0.5s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.budget-banner.warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left: 5px solid #f59e0b;
}

.budget-banner.exceeded {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-left: 5px solid #ef4444;
}

.budget-banner.predictive {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-left: 5px solid #3b82f6;
}

.alert-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.alert-prediction {
  font-size: 0.95em;
  color: #1e40af;
  margin-top: 4px;
}

.alert-advice {
  font-size: 0.9em;
  color: #059669;
  margin-top: 4px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  border-left: 3px solid #10b981;
}

.alert-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.alert-icon {
  font-size: 1.5em;
}

.alert-message {
  flex: 1;
  font-weight: 600;
  font-size: 1.1em;
  color: #1f2937;
}

.btn-alert-action {
  padding: 8px 16px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-alert-action:hover {
  background: #5a67d8;
  transform: translateY(-2px);
}

.btn-close-alert {
  background: none;
  border: none;
  font-size: 1.5em;
  color: #6b7280;
  cursor: pointer;
  padding: 0 10px;
}

.btn-close-alert:hover {
  color: #374151;
}

/* Dark Mode Specific Overrides */
[data-theme="dark"] {
  /* Cards and containers */
  .card,
  .auth-card,
  .modal-content,
  .expense-item,
  .category-item,
  .insight-card,
  .user-card,
  .budget-item,
  .budget-progress-card,
  .receipt-preview {
    background: var(--card-bg) !important;
    color: var(--text-primary);
    border-color: var(--border-color);
  }
  
  /* Inputs */
  input,
  textarea,
  select {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--input-border) !important;
  }
  
  input::placeholder,
  textarea::placeholder {
    color: var(--text-muted);
  }
  
  /* Text colors */
  h1, h2, h3, h4, h5, h6,
  p, span, div, label {
    color: inherit;
  }
  
  /* Specific overrides */
  .expense-item {
    background: var(--card-bg) !important;
  }
  
  .expense-item:hover {
    background: var(--input-bg) !important;
  }
  
  .analytics-stat-card,
  .prediction-item {
    background: var(--card-bg) !important;
    border-color: var(--border-color);
  }
  
  .chart-card,
  .filters-card,
  .add-expense-card {
    background: var(--card-bg) !important;
  }
  
  /* Modal overlay */
  .modal {
    background: var(--modal-overlay) !important;
  }
  
  /* Admin panel */
  .admin-panel {
    background: var(--card-bg) !important;
    border-color: var(--accent-primary);
  }
  
  /* Budget cards */
  .budget-progress-card.budget-warning {
    background: rgba(237, 137, 54, 0.1) !important;
  }
  
  .budget-progress-card.budget-exceeded {
    background: rgba(245, 101, 101, 0.1) !important;
  }
  
  /* SMS modal tabs */
  .sms-tab {
    background: var(--input-bg) !important;
    color: var(--text-secondary);
  }
  
  .sms-tab.active {
    background: var(--accent-primary) !important;
    color: white;
  }
  
  /* Upload prompt */
  .upload-prompt {
    background: var(--input-bg) !important;
    border-color: var(--border-color);
  }
  
  /* OCR result */
  .ocr-result {
    background: rgba(72, 187, 120, 0.1) !important;
    border-color: #48bb78;
  }
  
  /* Budget alert banner */
  .budget-banner.warning {
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.2) 0%, rgba(253, 230, 138, 0.2) 100%) !important;
  }
  
  .budget-banner.exceeded {
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.2) 0%, rgba(254, 202, 202, 0.2) 100%) !important;
  }
  
  /* Data items */
  .data-item {
    background: var(--input-bg) !important;
  }
  
  /* Share instructions */
  .share-instructions {
    background: var(--input-bg) !important;
  }
  
  /* Category tags */
  .cat-tag,
  .merchant-tag {
    background: var(--input-bg) !important;
    color: var(--text-primary);
  }
  
  /* Progress bar background */
  .progress-bar {
    background: var(--input-bg) !important;
  }
  
  /* Table elements */
  canvas {
    filter: brightness(0.9);
  }
  
  /* Header */
  .app-header {
    background: var(--card-bg) !important;
  }
  
  /* Summary cards - keep gradient icons visible */
  .summary-card {
    background: var(--card-bg) !important;
  }
  
  .card-icon {
    /* Keep original vibrant colors for icons */
    filter: brightness(1.1);
  }
  
  /* Ensure chart text is visible */
  .chart-card canvas {
    filter: none;
  }
}

/* Theme toggle button */
#themeToggle {
  transition: all 0.3s ease;
}

#themeToggle:hover {
  transform: scale(1.1) rotate(20deg);
}

[data-theme="dark"] #themeToggle {
  background: #fbbf24 !important;
}

[data-theme="dark"] #themeToggle i {
  color: #1f2937;
}

/* Onboarding Tutorial Styles */
.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.onboarding-highlight {
  position: relative;
  z-index: 9999 !important;
  box-shadow: 0 0 0 4px var(--accent-primary), 0 0 0 8px rgba(102, 126, 234, 0.3) !important;
  border-radius: 12px !important;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 4px var(--accent-primary), 0 0 0 8px rgba(102, 126, 234, 0.3);
  }
  50% {
    box-shadow: 0 0 0 4px var(--accent-primary), 0 0 0 12px rgba(102, 126, 234, 0.5);
  }
}

.onboarding-tooltip {
  position: absolute;
  z-index: 10000;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90vw;
  animation: tooltipAppear 0.3s ease;
}

[data-theme="dark"] .onboarding-tooltip {
  background: var(--card-bg);
  color: var(--text-primary);
}

@keyframes tooltipAppear {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.onboarding-tooltip::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border: 10px solid transparent;
}

.onboarding-tooltip.tooltip-top::before {
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: white;
}

[data-theme="dark"] .onboarding-tooltip.tooltip-top::before {
  border-top-color: var(--card-bg);
}

.onboarding-tooltip.tooltip-bottom::before {
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: white;
}

[data-theme="dark"] .onboarding-tooltip.tooltip-bottom::before {
  border-bottom-color: var(--card-bg);
}

.tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 15px;
  border-bottom: 2px solid #e2e8f0;
}

[data-theme="dark"] .tooltip-header {
  border-bottom-color: var(--border-color);
}

.tooltip-header h3 {
  margin: 0;
  font-size: 1.3em;
  color: var(--accent-primary);
}

.tooltip-close {
  background: none;
  border: none;
  font-size: 1.8em;
  color: #a0aec0;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.tooltip-close:hover {
  background: #f7fafc;
  color: var(--accent-primary);
}

[data-theme="dark"] .tooltip-close:hover {
  background: var(--input-bg);
}

.tooltip-content {
  padding: 20px;
}

.tooltip-content p {
  margin: 0;
  font-size: 1em;
  line-height: 1.6;
  color: #4a5568;
}

[data-theme="dark"] .tooltip-content p {
  color: var(--text-secondary);
}

.tooltip-footer {
  padding: 15px 20px 20px;
  border-top: 2px solid #e2e8f0;
}

[data-theme="dark"] .tooltip-footer {
  border-top-color: var(--border-color);
}

.tooltip-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 0.9em;
  color: #718096;
}

.progress-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: all 0.3s;
}

[data-theme="dark"] .dot {
  background: var(--border-color);
}

.dot.active {
  background: var(--accent-primary);
  transform: scale(1.3);
}

.dot.completed {
  background: #48bb78;
}

.tooltip-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-tooltip {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.95em;
}

.btn-tooltip.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
}

.btn-tooltip.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-tooltip.btn-secondary {
  background: #f7fafc;
  color: #4a5568;
}

[data-theme="dark"] .btn-tooltip.btn-secondary {
  background: var(--input-bg);
  color: var(--text-primary);
}

.btn-tooltip.btn-secondary:hover {
  background: #e2e8f0;
}

[data-theme="dark"] .btn-tooltip.btn-secondary:hover {
  background: var(--border-color);
}

/* Completion Message */
.onboarding-complete-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10001;
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 400px;
  width: 90vw;
  opacity: 0;
  transition: opacity 0.3s ease;
}

[data-theme="dark"] .onboarding-complete-message {
  background: var(--card-bg);
}

.onboarding-complete-message.show {
  opacity: 1;
}

.completion-icon {
  font-size: 4em;
  margin-bottom: 20px;
  animation: bounce 0.6s ease;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.completion-content h2 {
  font-size: 1.8em;
  margin-bottom: 10px;
  color: var(--accent-primary);
}

.completion-content p {
  font-size: 1.1em;
  color: #4a5568;
  margin: 0;
}

[data-theme="dark"] .completion-content p {
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .onboarding-tooltip {
    max-width: 90vw;
  }
  
  .tooltip-header h3 {
    font-size: 1.1em;
  }
  
  .tooltip-content p {
    font-size: 0.95em;
  }
  
  .tooltip-actions {
    flex-direction: column;
  }
  
  .btn-tooltip {
    width: 100%;
  }
}

.empty-state {
  text-align: center;
  color: #a0aec0;
  padding: 40px 20px;
  font-style: italic;
}

.share-instructions {
  background: #f7fafc;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.share-instructions h3 {
  margin-bottom: 15px;
  color: #2d3748;
}

.share-instructions p {
  font-weight: 600;
  color: #4a5568;
  margin: 15px 0 10px 0;
}

.share-instructions ol {
  margin-left: 20px;
  margin-bottom: 20px;
  color: #718096;
  line-height: 1.8;
}

.share-instructions button {
  margin-top: 15px;
  width: 100%;
}

/* =================================
   CSV Import Styles
   ================================= */

.csv-section {
  margin-bottom: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.csv-section:last-child {
  border-bottom: none;
}

.csv-upload-area {
  border: 2px dashed #cbd5e0;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
}

.csv-upload-area:hover {
  border-color: var(--accent-primary);
  background: rgba(102, 126, 234, 0.03);
}

.csv-upload-area p {
  margin: 10px 0;
  color: #4a5568;
}

.csv-info {
  font-size: 0.85em;
  color: #a0aec0 !important;
  margin-top: 15px !important;
}

.csv-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: var(--card-bg, #f7fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  margin-top: 15px;
}

.csv-file-info i {
  font-size: 24px;
  color: var(--accent-primary);
}

.csv-file-info span {
  flex: 1;
  font-weight: 500;
}

.csv-mapping-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.mapping-row {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 12px;
  align-items: center;
}

.mapping-row label {
  font-weight: 500;
  color: var(--text-primary, #2d3748);
}

.mapping-hint {
  color: #a0aec0;
  font-size: 0.9em;
  padding: 0 8px;
}

.csv-column-select,
.csv-format-select {
  padding: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  background: var(--card-bg, white);
  color: var(--text-primary, #2d3748);
  font-size: 0.95em;
}

.csv-column-select:focus,
.csv-format-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.csv-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding: 15px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stat-item strong {
  font-size: 1.5em;
  color: var(--accent-primary);
}

.stat-item span {
  font-size: 0.9em;
  color: #718096;
}

.csv-preview-container {
  max-height: 400px;
  overflow: auto;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  margin-bottom: 20px;
}

.csv-preview-table {
  width: 100%;
  border-collapse: collapse;
}

.csv-preview-table th {
  position: sticky;
  top: 0;
  background: var(--card-bg, #f7fafc);
  padding: 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color, #e2e8f0);
  color: var(--text-primary, #2d3748);
  z-index: 10;
}

.csv-preview-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-secondary, #4a5568);
}

.csv-preview-table tr:hover {
  background: rgba(102, 126, 234, 0.05);
}

.category-badge {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 500;
}

.csv-category-mapping {
  margin-top: 20px;
  padding: 15px;
  background: var(--card-bg, #f7fafc);
  border-radius: 8px;
}

.csv-category-mapping h4 {
  margin-bottom: 15px;
  color: var(--text-primary, #2d3748);
}

.csv-import-progress {
  text-align: center;
  padding: 30px 20px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border-color, #e2e8f0);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 15px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  transition: width 0.3s ease;
  width: 0%;
}

#csvProgressText {
  font-size: 1.1em;
  color: var(--text-primary, #2d3748);
  margin: 0;
}

#csvProgressText i {
  font-size: 1.3em;
  margin-right: 8px;
}

/* Dark mode overrides for CSV import */
[data-theme="dark"] .csv-upload-area {
  border-color: #4a5568;
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .csv-upload-area:hover {
  border-color: var(--accent-primary);
  background: rgba(102, 126, 234, 0.05);
}

[data-theme="dark"] .csv-upload-area p {
  color: #cbd5e0;
}

[data-theme="dark"] .csv-file-info {
  background: #2d3748;
  border-color: #4a5568;
}

[data-theme="dark"] .csv-stats {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
}

[data-theme="dark"] .csv-preview-table th {
  background: #2d3748;
  border-color: #4a5568;
}

[data-theme="dark"] .csv-preview-table td {
  border-color: #4a5568;
}

[data-theme="dark"] .csv-preview-table tr:hover {
  background: rgba(102, 126, 234, 0.08);
}

[data-theme="dark"] .csv-category-mapping {
  background: #2d3748;
}

[data-theme="dark"] .progress-bar {
  background: #4a5568;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .mapping-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mapping-row label {
    font-size: 0.9em;
  }

  .mapping-hint {
    display: none;
  }

  .csv-stats {
    flex-direction: column;
    gap: 15px;
  }

  .csv-preview-container {
    max-height: 300px;
  }

  .csv-preview-table {
    font-size: 0.85em;
  }

  .csv-preview-table th,
  .csv-preview-table td {
    padding: 8px;
  }
}

/* =================================
   Subscription Management Styles
   ================================= */

.subscriptions-widget {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border-left: 4px solid var(--accent-primary);
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.widget-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--text-primary, #2d3748);
}

.subscriptions-summary {
  display: flex;
  gap: 30px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.sub-stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sub-stat-value {
  font-size: 1.8em;
  font-weight: 700;
  color: var(--accent-primary);
}

.sub-stat-label {
  font-size: 0.9em;
  color: #718096;
}

.upcoming-subscriptions h4 {
  margin-bottom: 15px;
  color: var(--text-primary, #2d3748);
  font-size: 1em;
}

.upcoming-sub-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--card-bg, white);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  margin-bottom: 10px;
}

.upcoming-sub-item:last-child {
  margin-bottom: 0;
}

.upcoming-sub-item strong {
  display: block;
  color: var(--text-primary, #2d3748);
  margin-bottom: 3px;
}

.sub-date {
  font-size: 0.85em;
  color: #718096;
}

.sub-amount {
  font-weight: 600;
  color: var(--accent-primary);
  font-size: 1.1em;
}

/* Subscriptions Modal */
.subscriptions-scan-section {
  padding: 20px;
  background: var(--card-bg, #f7fafc);
  border-radius: 12px;
  margin-bottom: 25px;
}

.scan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.scan-header h3 {
  margin: 0;
  color: var(--text-primary, #2d3748);
}

.scan-status {
  margin-top: 15px;
  padding: 12px;
  background: rgba(102, 126, 234, 0.1);
  border-left: 3px solid var(--accent-primary);
  border-radius: 6px;
  color: var(--text-primary, #2d3748);
}

.detected-patterns-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
}

.detected-pattern-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 15px;
  background: var(--card-bg, white);
  border: 2px solid var(--accent-primary);
  border-radius: 12px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pattern-info {
  flex: 1;
}

.pattern-info h4 {
  margin: 0 0 10px 0;
  color: var(--text-primary, #2d3748);
}

.pattern-details {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.pattern-amount {
  font-weight: 600;
  color: var(--accent-primary);
  font-size: 1.1em;
}

.pattern-confidence,
.pattern-occurrences {
  font-size: 0.9em;
  color: #718096;
}

.pattern-next {
  font-size: 0.9em;
  color: #718096;
  margin: 5px 0 0 0;
}

.pattern-actions {
  display: flex;
  gap: 10px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.9em;
}

.btn-icon-sm {
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary, #4a5568);
}

.btn-icon-sm:hover {
  background: var(--card-bg, #f7fafc);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Bill Reminders */
.reminders-section {
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border-radius: 12px;
  color: white;
}

.reminders-section h3 {
  margin: 0 0 15px 0;
  color: white;
  font-size: 1.2em;
}

.upcoming-reminders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.no-reminders {
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95em;
}

.reminder-card {
  display: flex;
  gap: 12px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
}

.reminder-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.reminder-card.overdue {
  border: 2px solid #f56565;
  background: rgba(254, 215, 215, 0.95);
}

.reminder-icon {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.5em;
  flex-shrink: 0;
}

.reminder-details {
  flex: 1;
  min-width: 0;
}

.reminder-details h4 {
  margin: 0 0 5px 0;
  color: #2d3748;
  font-size: 1em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reminder-amount {
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 1.1em;
  margin: 0;
}

.reminder-due {
  margin: 5px 0 0 0;
  font-size: 0.85em;
  color: #718096;
}

.reminder-due .due-today {
  color: #ed8936;
  font-weight: 600;
}

.reminder-due .due-soon {
  color: #48bb78;
  font-weight: 600;
}

.reminder-due .overdue {
  color: #f56565;
  font-weight: 700;
}

.reminder-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #f56565;
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75em;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(245, 101, 101, 0.4);
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.9;
  }
}

.setting-description {
  margin: 5px 0 0 30px;
  font-size: 0.85em;
  color: var(--text-secondary, #718096);
}

/* Subscriptions List */
.subscriptions-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.subscription-card {
  padding: 15px;
  background: var(--card-bg, white);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  transition: all 0.3s;
}

.subscription-card:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.subscription-card.upcoming {
  border-color: #ed8936;
  background: rgba(237, 137, 54, 0.05);
}

.subscription-card.overdue {
  border-color: #f56565;
  background: rgba(245, 101, 101, 0.05);
}

.subscription-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
}

.subscription-merchant {
  flex: 1;
}

.subscription-merchant h4 {
  margin: 0 0 8px 0;
  color: var(--text-primary, #2d3748);
}

.subscription-amount {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--accent-primary);
}

.subscription-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.9em;
  color: #718096;
}

.subscription-details span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.subscription-details i {
  width: 16px;
  color: #a0aec0;
}

.subscription-notes {
  font-size: 0.9em;
  color: #718096;
  margin: 10px 0;
  padding: 10px;
  background: var(--bg-primary, #f7fafc);
  border-radius: 6px;
}

.subscription-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color, #e2e8f0);
}

/* Dark mode overrides */
[data-theme="dark"] .subscriptions-widget {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

[data-theme="dark"] .upcoming-sub-item {
  background: #2d3748;
  border-color: #4a5568;
}

[data-theme="dark"] .subscriptions-scan-section {
  background: #2d3748;
}

[data-theme="dark"] .scan-status {
  background: rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .detected-pattern-card {
  background: #2d3748;
  border-color: var(--accent-primary);
}

[data-theme="dark"] .subscription-card {
  background: #2d3748;
  border-color: #4a5568;
}

[data-theme="dark"] .subscription-card.upcoming {
  background: rgba(237, 137, 54, 0.1);
}

[data-theme="dark"] .subscription-card.overdue {
  background: rgba(245, 101, 101, 0.1);
}

[data-theme="dark"] .subscription-notes {
  background: #1a202c;
}

/* Responsive */
@media (max-width: 768px) {
  .subscriptions-summary {
    flex-direction: column;
    gap: 15px;
  }

  .scan-header {
    flex-direction: column;
    align-items: stretch;
  }

  .detected-pattern-card {
    flex-direction: column;
    align-items: stretch;
  }

  .pattern-actions {
    width: 100%;
  }

  .pattern-actions button {
    flex: 1;
  }

  .subscriptions-list {
    grid-template-columns: 1fr;
  }
}

/* =================================
   Export Manager Styles
   ================================= */

.export-filters {
  margin-bottom: 25px;
  padding: 20px;
  background: var(--card-bg, #f7fafc);
  border-radius: 12px;
}

.export-filters h3 {
  margin: 0 0 15px 0;
  color: var(--text-primary, #2d3748);
}

.date-range-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-weight: 500;
  color: var(--text-primary, #2d3748);
  font-size: 0.9em;
}

.date-input {
  padding: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  background: var(--card-bg, white);
  color: var(--text-primary, #2d3748);
  font-size: 0.95em;
}

.date-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.export-preview-section {
  margin-bottom: 25px;
}

.export-preview-section h3 {
  margin: 0 0 15px 0;
  color: var(--text-primary, #2d3748);
}

.export-preview {
  padding: 20px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
}

.export-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.export-stat {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.9em;
  color: #718096;
  margin-bottom: 5px;
}

.stat-value {
  display: block;
  font-size: 1.5em;
  font-weight: 700;
  color: var(--accent-primary);
}

.export-categories h4 {
  margin: 0 0 15px 0;
  color: var(--text-primary, #2d3748);
  font-size: 1em;
}

.export-category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: var(--card-bg, white);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  margin-bottom: 8px;
}

.export-category-item:last-child {
  margin-bottom: 0;
}

.export-options h3 {
  margin: 0 0 10px 0;
  color: var(--text-primary, #2d3748);
}

.export-format-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 15px;
}

.export-format-card {
  padding: 20px;
  background: var(--card-bg, white);
  border: 2px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s;
}

.export-format-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

.format-icon {
  margin-bottom: 15px;
}

.export-format-card h4 {
  margin: 0 0 10px 0;
  color: var(--text-primary, #2d3748);
}

.export-format-card p {
  color: #718096;
  margin-bottom: 10px;
  font-size: 0.9em;
}

.export-format-card ul {
  text-align: left;
  margin: 10px 0;
  padding-left: 25px;
  color: #718096;
  font-size: 0.9em;
}

.export-format-card li {
  margin-bottom: 6px;
}

/* Dark mode overrides */
[data-theme="dark"] .export-filters {
  background: #2d3748;
}

[data-theme="dark"] .export-preview {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-color: #4a5568;
}

[data-theme="dark"] .export-category-item {
  background: #2d3748;
  border-color: #4a5568;
}

[data-theme="dark"] .export-format-card {
  background: #2d3748;
  border-color: #4a5568;
}

[data-theme="dark"] .export-format-card:hover {
  border-color: var(--accent-primary);
}

/* Responsive */
@media (max-width: 768px) {
  .date-range-inputs {
    grid-template-columns: 1fr;
  }

  .export-stats {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .export-format-cards {
    grid-template-columns: 1fr;
  }
}

/* =================================
   Paywall & Pricing Styles
   ================================= */

.plan-status-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 15px 20px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 12px;
  margin-bottom: 20px;
}

.plan-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9em;
  white-space: nowrap;
}

.plan-badge.plan-free {
  background: #e2e8f0;
  color: #4a5568;
}

.plan-badge.plan-premium {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
}

.plan-badge.plan-family {
  background: var(--accent-primary);
  color: white;
}

.plan-badge.plan-business {
  background: var(--accent-secondary);
  color: white;
}

.usage-info {
  flex: 1;
}

.usage-bar {
  width: 100%;
  height: 8px;
  background: var(--border-color, #e2e8f0);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}

.usage-fill {
  height: 100%;
  background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
  transition: width 0.3s ease;
}

.usage-text {
  font-size: 0.85em;
  color: #718096;
  margin: 0;
}

.usage-text.unlimited {
  color: var(--accent-primary);
  font-weight: 600;
}

.limit-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 20px;
  background: linear-gradient(135deg, rgba(245, 101, 101, 0.1) 0%, rgba(237, 137, 54, 0.1) 100%);
  border-left: 4px solid #f56565;
  border-radius: 8px;
  margin-bottom: 20px;
}

.limit-banner-content {
  display: flex;
  align-items: start;
  gap: 15px;
  flex: 1;
}

.limit-banner-content i {
  font-size: 24px;
  color: #f56565;
  margin-top: 2px;
}

.limit-banner-content strong {
  display: block;
  color: var(--text-primary, #2d3748);
  margin-bottom: 5px;
}

.limit-banner-content p {
  color: #718096;
  margin: 0;
  font-size: 0.9em;
}

.premium-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  border-radius: 50%;
  color: #333;
  font-size: 10px;
  margin-left: 8px;
  animation: pulse 2s infinite;
}

/* Pricing Modal */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.pricing-card {
  padding: 30px 20px;
  background: var(--card-bg, white);
  border: 2px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s;
  position: relative;
}

.pricing-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.pricing-card.featured {
  border-color: var(--accent-primary);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.pricing-card.current-plan {
  border-color: #48bb78;
  background: rgba(72, 187, 120, 0.05);
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  padding: 4px 16px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 600;
}

.pricing-card h3 {
  margin: 0 0 15px 0;
  color: var(--text-primary, #2d3748);
  font-size: 1.5em;
}

.price {
  margin-bottom: 20px;
}

.price .amount {
  font-size: 2.5em;
  font-weight: 700;
  color: var(--accent-primary);
}

.price .period {
  font-size: 0.9em;
  color: #718096;
}

.features-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  text-align: left;
}

.features-list li {
  padding: 10px 0;
  color: var(--text-primary, #2d3748);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9em;
}

.features-list i.fa-check {
  color: #48bb78;
}

.features-list i.fa-times {
  color: #cbd5e0;
}

.text-muted {
  color: #a0aec0 !important;
}

.select-plan-btn {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
}

.select-plan-btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.pricing-note {
  text-align: center;
  padding: 20px;
  background: rgba(102, 126, 234, 0.05);
  border-radius: 8px;
}

.pricing-note p {
  color: #718096;
  margin: 0;
  font-size: 0.9em;
}

.pricing-note i {
  color: #48bb78;
  margin-right: 5px;
}

/* Feature Locked Modal */
.locked-icon {
  margin-bottom: 20px;
}

#featureLockedModal h3 {
  color: var(--text-primary, #2d3748);
}

/* Dark mode overrides */
[data-theme="dark"] .plan-status-bar {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
}

[data-theme="dark"] .plan-badge.plan-free {
  background: #4a5568;
  color: #f7fafc;
}

[data-theme="dark"] .usage-bar {
  background: #4a5568;
}

[data-theme="dark"] .limit-banner {
  background: linear-gradient(135deg, rgba(245, 101, 101, 0.15) 0%, rgba(237, 137, 54, 0.15) 100%);
}

[data-theme="dark"] .pricing-card {
  background: #2d3748;
  border-color: #4a5568;
}

[data-theme="dark"] .pricing-card.featured {
  border-color: var(--accent-primary);
}

[data-theme="dark"] .pricing-card.current-plan {
  background: rgba(72, 187, 120, 0.1);
}

[data-theme="dark"] .pricing-note {
  background: rgba(102, 126, 234, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
  .plan-status-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .plan-badge {
    justify-content: center;
  }

  .limit-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .limit-banner-content {
    flex-direction: column;
  }

  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .pricing-card {
    padding: 25px 15px;
  }

  .price .amount {
    font-size: 2em;
  }
}

/* =================================
   Floating Voice Button
   ================================= */

.floating-voice-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
  z-index: 1000;
  animation: float 3s ease-in-out infinite;
}

.floating-voice-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.floating-voice-btn:active {
  transform: scale(0.95);
}

.floating-voice-btn.listening {
  background: linear-gradient(135deg, #f56565 0%, #ed8936 100%);
  animation: pulse 1s ease-in-out infinite;
}

.floating-voice-btn.listening::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid #f56565;
  animation: ripple 1.5s ease-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes ripple {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Dark mode */
[data-theme="dark"] .floating-voice-btn {
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
}

[data-theme="dark"] .floating-voice-btn:hover {
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.7);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .floating-voice-btn {
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    font-size: 22px;
  }
}

/* ===== Sync Status Indicator ===== */
.sync-status {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 999;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.sync-status.online {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
}

.sync-status.offline {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
  color: white;
  animation: pulse 2s ease-in-out infinite;
}

.sync-status.syncing {
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
  color: white;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Dark mode sync status */
[data-theme="dark"] .sync-status {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Clear Filters Button - Better styling */
#clearFiltersBtn {
  background: #f56565 !important;
  color: white !important;
  border-radius: 8px;
  transition: all 0.3s ease;
  border: none;
  padding: 8px 12px !important;
  min-width: 44px !important;
  width: auto !important;
  height: 44px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#clearFiltersBtn:hover {
  background: #e53e3e !important;
  transform: scale(1.05);
}

#clearFiltersBtn:active {
  transform: scale(0.95);
}

/* Ad Banner Styling */
#bannerAdContainer {
  max-height: 100px !important;
  min-height: 50px;
  overflow: hidden !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

#bannerAdContainer ins {
  max-height: 90px !important;
}

/* Dark mode support */
[data-theme="dark"] #clearFiltersBtn {
  background: #fc8181 !important;
}

[data-theme="dark"] #clearFiltersBtn:hover {
  background: #f56565 !important;
}

/* Ad Banner Constraints - Prevent bloating */
#bannerAdContainer {
  max-height: 90px !important;
  min-height: 60px !important;
  overflow: hidden !important;
}

#bannerAdContainer .adsbygoogle {
  max-height: 60px !important;
  height: 60px !important;
  display: inline-block !important;
}

#bannerAdContainer ins {
  max-height: 60px !important;
  overflow: hidden !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .sync-status {
    top: 10px;
    right: 10px;
    padding: 8px 15px;
    font-size: 12px;
  }
  
  #bannerAdContainer {
    max-height: 80px !important;
    padding: 3px !important;
  }
  
  #bannerAdContainer .adsbygoogle {
    max-height: 50px !important;
    height: 50px !important;
  }
}


/* Tax Category System Styles */
.tax-summary-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.tax-total-card {
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tax-total-card.deductible {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-left: 4px solid #10b981;
}

.tax-total-card.non-deductible {
  background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
  border-left: 4px solid #ef4444;
}

.tax-total-card.total {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-left: 4px solid #3b82f6;
}

.tax-label {
  font-size: 0.9em;
  color: #4a5568;
  font-weight: 600;
  margin-bottom: 8px;
}

.tax-amount {
  font-size: 1.8em;
  font-weight: 700;
  color: #1a202c;
}

.tax-breakdown {
  margin-top: 30px;
}

.tax-categories-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tax-category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: var(--card-bg, white);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  transition: all 0.2s;
}

.tax-category-item.deductible {
  border-left: 3px solid #10b981;
}

.tax-disclaimer {
  margin-top: 30px;
  padding: 15px 20px;
  background: rgba(59, 130, 246, 0.1);
  border-left: 4px solid #3b82f6;
  border-radius: 8px;
}

