:root {
  --primary: #1e293b;
  --primary-light: #334155;
  --primary-accent: #0f172a;
  --secondary: #0ea5e9;
  --secondary-dark: #0284c7;
  --success: #10b981;
  --success-dark: #059669;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --warning: #f59e0b;
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  color: var(--neutral-700);
  background-color: var(--neutral-50);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--neutral-50) 0%, var(--neutral-100) 100%);
}

.app-header {
  background: linear-gradient(135deg, var(--primary-accent) 0%, var(--primary) 100%);
  color: white;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-header h1 {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 0%, #f0f9ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-size: 0.8125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--secondary);
  color: white;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
  background-color: var(--secondary-dark);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.btn-block {
  width: 100%;
}

.btn-danger {
  background-color: var(--danger);
  color: white;
  padding: 0.625rem 1.25rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background-color: var(--danger-dark);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.wallets-summary {
  margin-bottom: 2.5rem;
}

.wallets-summary h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0 0 1.5rem 0;
  color: var(--neutral-900);
  letter-spacing: -0.3px;
}

.wallets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.wallet-card {
  background: white;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.wallet-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: inherit;
}

.wallet-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--secondary);
}

.wallet-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: inline-block;
}

.wallet-name {
  font-size: 0.875rem;
  color: var(--neutral-500);
  margin-bottom: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wallet-balance {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--neutral-900);
  letter-spacing: -0.5px;
}

.total-balance {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: white;
  padding: 2rem 2.5rem;
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.total-balance span:first-child {
  font-size: 1rem;
  opacity: 0.95;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.balance-amount {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.stats-section {
  margin-bottom: 2.5rem;
}

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

.stat-card {
  background: white;
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 4px solid;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  opacity: 0.05;
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.stat-card.income {
  border-left-color: var(--success);
}

.stat-card.income::after {
  background-color: var(--success);
}

.stat-card.expense {
  border-left-color: var(--danger);
}

.stat-card.expense::after {
  background-color: var(--danger);
}

.stat-card.savings {
  border-left-color: var(--secondary);
}

.stat-card.savings::after {
  background-color: var(--secondary);
}

.stat-icon {
  font-size: 2.5rem;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

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

.stat-value {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--neutral-900);
  letter-spacing: -0.5px;
}

.transactions-section {
  background: white;
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.section-header h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0;
  color: var(--neutral-900);
  letter-spacing: -0.3px;
}

.filter-buttons {
  display: flex;
  gap: 0.75rem;
  background-color: var(--neutral-100);
  padding: 0.5rem;
  border-radius: var(--radius-md);
}

.filter-btn {
  padding: 0.625rem 1.25rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--neutral-600);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.filter-btn:hover {
  color: var(--neutral-900);
}

.filter-btn.active {
  background-color: white;
  color: var(--secondary);
  box-shadow: var(--shadow-sm);
}

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

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  background: var(--neutral-50);
  border-radius: var(--radius-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 3px solid var(--neutral-200);
}

.transaction-item:hover {
  background: var(--neutral-100);
  border-left-color: var(--secondary);
  transform: translateX(2px);
}

.transaction-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
}

.transaction-icon {
  font-size: 1.5rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: white;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.transaction-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.transaction-category {
  font-weight: 700;
  color: var(--neutral-900);
  font-size: 0.9375rem;
}

.transaction-description {
  font-size: 0.8125rem;
  color: var(--neutral-500);
}

.transaction-meta {
  font-size: 0.75rem;
  color: var(--neutral-400);
  margin-top: 0.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.transaction-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  margin-left: 1rem;
}

.transaction-amount {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.transaction-amount.income {
  color: var(--success);
}

.transaction-amount.expense {
  color: var(--danger);
}

.transaction-date {
  font-size: 0.75rem;
  color: var(--neutral-400);
  font-weight: 600;
}

.transaction-actions {
  margin-left: 1rem;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--neutral-900);
  letter-spacing: -0.3px;
}

.close-btn {
  background: var(--neutral-100);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--neutral-600);
  padding: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-md);
  line-height: 1;
}

.close-btn:hover {
  color: var(--neutral-900);
  background-color: var(--neutral-200);
  transform: rotate(90deg);
}

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

.form-group label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: var(--neutral-800);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.875rem 1.125rem;
  border: 1.5px solid var(--neutral-300);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: var(--neutral-50);
  font-family: inherit;
  color: var(--neutral-900);
}

.form-group input::placeholder {
  color: var(--neutral-400);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--secondary);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.type-toggle {
  display: flex;
  gap: 0.75rem;
  background-color: var(--neutral-100);
  padding: 0.5rem;
  border-radius: var(--radius-md);
}

.type-btn {
  flex: 1;
  padding: 0.875rem;
  border: 2px solid transparent;
  background: white;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  font-size: 0.8125rem;
  letter-spacing: 0.3px;
  color: var(--neutral-600);
}

.type-btn:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

.type-btn.active {
  background-color: var(--secondary);
  color: white;
  border-color: var(--secondary);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.wallet-list-modal {
  margin-bottom: 2rem;
}

.wallet-item-modal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  background: var(--neutral-50);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  border: 1px solid var(--neutral-200);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wallet-item-modal:hover {
  border-color: var(--secondary);
  background-color: white;
  box-shadow: var(--shadow-sm);
}

.wallet-item-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.wallet-item-icon {
  font-size: 1.75rem;
}

.wallet-item-details h4 {
  margin: 0 0 0.35rem 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--neutral-900);
}

.wallet-item-details p {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--secondary);
}

.modal-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neutral-200), transparent);
  margin: 2rem 0;
}

.modal-content h4 {
  margin: 0 0 1.5rem 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--neutral-900);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--neutral-400);
}

.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.empty-state p {
  margin: 0;
  font-size: 1rem;
  color: var(--neutral-500);
  font-weight: 500;
}

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
    padding: 1.5rem;
  }

  .app-header h1 {
    font-size: 1.5rem;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .main-content {
    padding: 1.5rem 1rem;
  }

  .wallets-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-buttons {
    justify-content: space-between;
  }

  .filter-btn {
    flex: 1;
  }

  .transaction-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .transaction-right {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-left: 0;
  }

  .modal-content {
    padding: 1.75rem;
    max-width: 90vw;
  }

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

  .btn {
    padding: 0.625rem 1.125rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .app-header h1 {
    font-size: 1.25rem;
  }

  .wallets-summary h2,
  .section-header h2 {
    font-size: 1.125rem;
  }

  .wallet-balance {
    font-size: 1.5rem;
  }

  .balance-amount {
    font-size: 1.75rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .transaction-item {
    padding: 1rem;
  }

  .transaction-icon {
    width: 2.5rem;
    height: 2.5rem;
  }

  .filter-buttons {
    flex-direction: column;
  }

  .filter-btn {
    padding: 0.5rem;
    font-size: 0.75rem;
  }
}
