* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

header {
  text-align: center;
  margin-bottom: 30px;
}

header h1 {
  color: #667eea;
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.subtitle {
  color: #666;
  font-size: 1.1rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  color: white;
}

.stat-label {
  display: block;
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: bold;
}

.form-section {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 15px;
  margin-bottom: 30px;
}

.form-section h2 {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.3rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  background: white;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.checkbox-item:hover {
  background: #f0f0f0;
}

.checkbox-item input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}

.checkbox-item label {
  margin: 0;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn {
  padding: 14px 28px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 100%;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 10px;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  font-size: 1rem;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s;
}

.tab-btn:hover {
  background: #f0f0f0;
}

.tab-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.tab-content {
  display: block;
}

.tab-content.hidden {
  display: none;
}

.tab-content h2 {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.3rem;
}

.saldos-list {
  display: grid;
  gap: 15px;
}

.saldo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border-left: 5px solid #667eea;
}

.saldo-item.positive {
  border-left-color: #10b981;
  background: #ecfdf5;
}

.saldo-item.negative {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.saldo-info {
  flex: 1;
}

.saldo-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.saldo-value {
  font-size: 1.2rem;
  font-weight: bold;
}

.saldo-value.positive {
  color: #10b981;
}

.saldo-value.negative {
  color: #ef4444;
}

.gastos-list {
  display: grid;
  gap: 15px;
}

.gasto-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border-left: 5px solid #667eea;
}

.gasto-info {
  flex: 1;
}

.gasto-desc {
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.gasto-details {
  font-size: 0.9rem;
  color: #666;
}

.gasto-value {
  font-size: 1.3rem;
  font-weight: bold;
  color: #667eea;
  margin-right: 15px;
}

.btn-delete {
  padding: 8px 16px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.3s;
}

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

@media (max-width: 600px) {
  .container {
    padding: 20px;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  .checkbox-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}